BSD Sockets Interface Programmer's Guide
Chapter 3 79
Advanced Topics for Stream Sockets
Using Shutdown
Function result: 0 if shutdown is successful, –1 if failure occurs.
Example: shutdown (s, 1);
When to Shut Down a Socket
Optionally, after the process has sent all messages and wants to indicate
that it is done sending, shut down the server or client process. Refer to
the shutdown(2) man page for more information on shutdown.
Parameter
Description of
Contents
INPUT Value
s socket descriptor socket descriptor of socket
to be shut down
how number that indicates
the type of shutdown
0, 1 or 2