|
Description
The shutdown() function causes either one or both ends of a full duplex connection over a socket to be shut down. The s parameter designates the socket concerned.
shutdown() has the following effects, depending on the value of the how parameter:
If the how parameter has the value SHUT_RD, shutdown() prevents receiving further messages.
If the how parameter has the value SHUT_WR, shutdown() prevents sending further messages.
If the how parameter has the value SHUT_RDWR, shutdown() prevents both receiving and sending further messages.
Return value
0:
If successful.
-1:
If errors occur. errno is set to indicate the error.
Errors
EBADF
The s parameter is not a valid descriptor.
ENOTSOCK
Descriptor s references a file and not a socket.
ENOTCONN
The socket has no connection.