while (!done) { try { Socket data; data = server.accept(); run(data); } catch (IOException ioe) { System.out.println("Accept error " + ioe); } }
done = true;
server = new ServerSocket(port); serverThreads = new Thread[nThreads]; for (int i = 0; i < nThreads; i++) { serverThreads[i] = new Thread(this); serverThreads[i].start(); }