
Chapter 14. Building roll your own clients 291
Closing the socket connection
To close the socket connection, use the close() function using the socket descriptor as a
parameter.
In the sample program, we use a
transaction socket. That means that the IMS Connect host
will close the connection as soon as the transaction has completed. Therefore, if we try to
send a second transaction to IMS, we receive an input output error, because we are trying to
write to a socket that has the remote end closed. If we want to send more than one
transaction without reopening the socket, we use a
permanent socket. See Chapter 7, “IMS
Connect programming model” ...