Shutdown the socket after checking the server status.