shutdown - shut down socket send and receive operations
int shutdown(intsocket, int how);
- Specifies the file descriptor of the socket.
- Specifies the type of shutdown. The values are as follows:
- Disables further receive operations.
- Disables further send operations.
- Disables further send and receive operations.
shutdown()function disables subsequent send and/or receive operations on a socket, depending on the value of the how argument.
Upon successful completion,
shutdown()returns 0. Otherwise, -1 is returned and errno is set to indicate the error.
shutdown()function will fail if:
- The socket argument is not a valid file descriptor.
- The how argument is invalid.
- The socket is not connected.
- The socket argument does not refer to a socket.
shutdown()function may fail if:
- Insufficient resources were available in the system to perform the operation.
- There were insufficient STREAMS resources available for the operation to complete.
getsockopt(), read(), recv(), recvfrom(), recvmsg(), select(), send(), sendto(), setsockopt(), socket(), write(), <sys/socket.h>.
First released in Issue 4.