The socket call shuts down all or part of a full-duplex connection.
Syntax
#include <sys\socket.h> int shutdown(s, howto) int s; int howto;
Parameters
s
Description
This call shuts down all or part of a full-duplex connection. Since data flows in one direction are independent of data flows in the other direction, the shutdown call allows you to independently stop data flow in either direction or all data flows with one API call. For example, you may want to stop the sender(s) from sending data to you, but you still want to send data.
Using the shutdown() call is optional.
The howto parameter sets the condition for shutting down the connection to socket s. It can be set to one of the following:
Note: In the NetBIOS domain, the shutdown() call has no effect. When called, shutdown() will return a successful return code, but no shutdown occurs.
Return Values
The value 0 indicates success; the value -1 indicates an error. You can get the specific error code by calling sock_errno() or psock_errno().
Error Code
Related Calls
accept() connect()
getsockopt()
readv()
recv()
recvfrom()
recvmsg()
select()
send()
sendto()
setsockopt()
sock_errno()
soclose()
socket()
writev()