private void run() { try { while (true) { ((Connection)closeQueue.dequeue()).closeSocket(); } } catch (EndOfQueueException e) {} }
private void run() { try { while (true) { Connection conn = (Connection) connectQueue.dequeue(); parent.addConnection(conn.connect()); } } catch (EndOfQueueException e) {} synchronized (this) { done = true; notifyAll(); while (!exit) { try { wait(); } catch (InterruptedException x) {} } } }