Disconnecting the Client
Once the client is completed sending and receiving data, the client disconnects from the server and shutdowns the socket.
To disconnect and shutdown a socket
- When the client is done sending data to the server, the shutdown function can be called specifying SD_SEND to shutdown the sending side of the socket. This allows the server to release some of the resources for this socket. The client application can still receive data on the socket.
- When the client application is done receiving data, the closesocket function is called to close the socket.
When the client application is completed using the Windows Sockets DLL, the WSACleanup function is called to release resources.