Server based SwingWorker does not Stop
I have a boolean variable to control the execution of the server (start/stop) : private boolean ecoute=true; here is my class: sw=new SwingWorker<String,Void> (){ protected String doInBackground() throws Exception { try { server = new ServerSocket(Integer.parseInt(port.getText())); String str1="waiting for connexion.."; String str2="Connexion ok"; log.append(str1+"\n"); PrintWriter out=null; BufferedReader in=null; Socket socClient=null; while(ecoute){ socClient = server.accept(); log.append(str2+"\n"); in = new BufferedReader( new InputStreamReader(socClient.getInputStream()) ); out = new