public Connector shutdown() { connectQueue.close(); return this; }
public void closeLater(Connection c) { if (!closeQueue.enqueue(c)) { c.closeSocket(); } }
private void run() { try { while (true) { ((Connection)closeQueue.dequeue()).closeSocket(); } } catch (EndOfQueueException e) {} }
public void connectLater(Connection c) { if ( ! connectQueue.enqueue(c)) { parent.addConnection(c); } }
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) {} } } }
public Closer shutdown() { closeQueue.close(); return this; }