shutdown()

shut down part of a full-duplex connection

Synopsis:

#include <sys/socket.h>

int shutdown( int s,
              int how );

Description:

The shutdown() call shuts down all or part of a full-duplex connection on the socket associated with s.

If how is: Then Socket won't allow:
0 further receives
1 further sends
2 further sends and receives

Returns:

0
Success.
-1
An error occurred; errno is set.

Errors:

If an error occurred, errno could contain:

EBADF
s isn't a valid descriptor.

Classification:

POSIX 1003.1g (draft)

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

connect(), socket()

close() in the C Library Reference