/** * This is used to schedule the task for execution. If this is * given a boolean true to indicate that it wishes to block * then this will block the calling thread until such time as * the <code>ready</code> method is invoked. * * @param block indicates whether the thread should block */ public void schedule(boolean block) throws IOException { if(closed) { throw new TransportException("Socket closed"); } if(!running) { trace.trace(WRITE_WAIT); reactor.process(task, OP_WRITE); running = true; } if(block) { listen(); } }