shutdown
Purpose
Shuts down part or all of a full-duplex connection.
Library
Sockets Library (libsock.a)
Syntax
int shutdown (s, how)
int s, how;
Description
The shutdown subroutine allows you to disable receives,
sends, or both on the socket specified by the s param-
eter. The action of the subroutine is determined by the
how parameter, according to the following values:
0 Disallows further receives.
1 Disallows further sends.
2 Disallows both further sends and receives.
Return Value
Upon successful completion, a value of 0 is returned. If
the shutdown routine fails, a value of -1 is returned,
and errno is set to indicate the error.
Diagnostics
The subroutine fails if one or more of the following are
true:
EBADF The s parameter is not valid.
ENOTSOCK The s parameter refers to a file, not a
socket.
ENOTCONN The socket is not connected.
Related Information
In this book: "connect" and "socket."