Java SwingWorker Socket Server does not get cancelled when i cancel the the SwingWorker
问题 I got a Socket Server running as a Java SwingWorker. The SwingWorker receives incoming connections, and upon connection, hands over the socket to an Executor that takes care of the connection. The Executor calls a SocketHandler that will handle the socket via the run() method. Now, I have one button on the GUI that says stop. I want to stop the SwingWorker from execution when i press the Stop button. To do so, I had a cancel(true) method called upon pressing the Stop button. Now, the