How can I interrupt a ServerSocket accept() method?

You can call close() from another thread, and the accept() call will throw a SocketException.

Leave a Comment