![]() |
![]() |
|
|
![]() |
![]() |
HP 9000 Networking: BSD Sockets Interface Programmer's Guide > Chapter 3 Advanced Topics for Stream Sockets![]() Using Shutdown |
|
When your program is done reading or writing on a particular socket connection, you can use shutdown to bring down a part of the connection. When one process uses shutdown on a socket descriptor, all other processes with the same socket descriptor are affected. shutdown causes all or part of a full-duplex connection on the specified socket to be disabled. When shutdown is executed, the specified socket is marked unable to send or receive, according to the value of how.
If you use close on a socket, close pays attention to the SO_LINGER option, but shutdown(s, 2) does not. With close, the socket descriptor is deallocated and the last process using the socket destroys it. shutdown and its parameters are described in the following table.
|
![]() |
||
![]() |
![]() |
![]() |
|||||||||||||
|