public void run() { while (thread != null) { try { System.out.println("Waiting for a client ..."); addThread(server.accept()); } catch (IOException ioe) { System.out.println("Server accept error: " + ioe); stop(); } } }