|
Closing a TCP Connection
- In the simplest case close works well
- Sometimes it is important to tell the server that a client
will send no more requests, while still keeping the socket
available for reading.
res = shutdown ( s, 1 );
- The 1 means no more writes will happen
- The server detects end of file on the socket
- After the server sends all the replies it can close
|