I have an application where a ServerSocket will accept a big number of clients and every client will have a thread assigned. The clients will communicate with the server and if one client will send the command: "enough" the server will stop working. The question is, how can I do this if only the thread is responsible with the client? How can a command issued by a client stop the server? Is there any way I can close the ServerSocket from the thread? Thanks in advance.
Asked
Active
Viewed 17 times
0
-
I believe you can check [this answer](https://stackoverflow.com/questions/2983835/how-can-i-interrupt-a-serversocket-accept-method) – Charliocat Apr 24 '20 at 12:48
-
Thanks I think this will help me! – rubberBoy Apr 24 '20 at 14:18