/** * This is executed when the flusher is to write all of the data to * the underlying socket. In this situation the writes are attempted * in a non blocking way, if the task does not complete then this * will simply enqueue the writing task for OP_WRITE and leave the * method. This returns true if all the buffers are written. */ public synchronized void execute() throws IOException { boolean ready = buffer.flush(); if(!ready) { boolean block = !buffer.ready(); if(!block && !closed) { scheduler.release(); } scheduler.repeat(); } else{ scheduler.ready(); } }
/** * This is executed when the flusher is to write all of the data to * the underlying socket. In this situation the writes are attempted * in a non blocking way, if the task does not complete then this * will simply enqueue the writing task for OP_WRITE and leave the * method. This returns true if all the buffers are written. */ public synchronized void execute() throws IOException { boolean ready = buffer.flush(); if(!ready) { boolean block = !buffer.ready(); if(!block && !closed) { scheduler.release(); } scheduler.repeat(); } else{ scheduler.ready(); } }