Sure, also you don't shut down the server socket, only the client socket. The server socket stays open to handle future communications. The accept() function will actually take the socket connection from the Server Socket and move it over to the client socket. The server socket acts like a post office, rerouting your mail to your mailbox (like the client socket), so closing it would impede future communications.

HTH,