Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
close() z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference SC27-3660-00 |
|
The close() call shuts down the socket associated with the socket descriptor s and frees resources allocated to the socket. If s refers to an open TCP connection, the connection is closed. If a stream socket is closed when there is input data queued, the TCP connection is reset, not cleanly closed. If you specify 0 on SO_LINGER on the setsockopt() call, the data is canceled and the CLOSE is immediately returned. If you do not specify a value for SO_LINGER on the setsockopt() call, the CLOSE returns and TCP/IP tries to immediately resend the data. Note: Issue
a shutdown() call before issuing a close() call for any socket.
Return valuesThe value 0 indicates
success; the value -1 indicates an error. Errno identifies the specific
error.
Related callsaccept(), getsockopt(), setsockopt(), socket() |
Copyright IBM Corporation 1990, 2014
|