grizeldi grizeldi - 7 months ago 14
Java Question

What happens on closing ServerSocket

What happens to client Sockets when I close a ServerSocket?
Will all connections made with serverSocket.accept() be closed as well?

Answer

Closing a ServerSocket will prevent new connections from being created, but it won't shut down existing connections.