grizeldi grizeldi - 1 year ago 86
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 Source

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