shutdown(2)
NAME
shutdown − shut down part of a full-duplex connection
SYNTAX
int shutdown(s, how)
int s, how;
DESCRIPTION
The shutdown system call causes all or part of a full-duplex connection on socket s to be shut down. If how is 0, then further receives will be disallowed. If how is 1, then further sends will be disallowed. If how is 2, then further sends and receives will be disallowed.
RETURN VALUE
If unsuccessful, returns a −1, and the global variable errno indicates the error code.
DIAGNOSTICS
The shutdown call will fail if:
[EBADF] The specified s is not a valid descriptor.
[ENOTSOCK] The specified s is a file, not a socket.
[ENOTCONN] The specified socket is not connected.