The
shutdown() call shuts down all or part of a duplex connection. Parameter how sets
the condition for shutdown to the socket s connection.
If
you issue a shutdown() for a socket that currently has outstanding
socket calls pending, see Table 1 to
determine the effects of this operation on the outstanding socket
calls.
Note: Issue a shutdown() call before issuing a close()
call for a socket.
#include <manifest.h>
#include <socket.h>
int shutdown(int s, int how)
- Parameter
- Description
- s
- The socket descriptor.
- how
- The how condition
can have a value of 0, 1, or 2, where:
- Zero ends further receive operations.
- One ends further send operations.
- Two ends further send and receive operations.
Return values
The value 0 indicates success;
the value -1 indicates an error. Errno identifies the specific
error.
- Errno
- Description
- EBADF
- Indicates that s is not a valid socket
descriptor.
- EINVAL
- The how parameter was not set to a valid
value: 0, 1, or 2.