/** * This method is used to flush all of the queued buffers to * the client. This method will not block but will simply flush * any data to the underlying transport. Internally the data * will be queued for delivery to the connected entity. */ public void flush() throws IOException { boolean done = writer.flush(); // returns true only if everything is delivered if(!done) { flusher.flush(); // here we will block for an op write event if the buffer contains a reference } }
/** * This method is used to flush all of the queued buffers to * the client. This method will not block but will simply flush * any data to the underlying transport. Internally the data * will be queued for delivery to the connected entity. */ public void flush() throws IOException { boolean done = writer.flush(); // returns true only if everything is delivered if(!done) { flusher.flush(); // here we will block for an op write event if the buffer contains a reference } }
/** * This is used to close the flusher ensuring that all of the * data within the writer will be flushed regardless of the * amount of data within the writer that needs to be written. If * the writer does not block then this waits to be finished. */ public synchronized void close() throws IOException { boolean ready = buffer.flush(); if(!closed) { closed = true; } if(!ready) { scheduler.schedule(true); } } }
/** * This is used to close the flusher ensuring that all of the * data within the writer will be flushed regardless of the * amount of data within the writer that needs to be written. If * the writer does not block then this waits to be finished. */ public synchronized void close() throws IOException { boolean ready = buffer.flush(); if(!closed) { closed = true; } if(!ready) { scheduler.schedule(true); } } }
/** * 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(); } }
if(!flush(duplicate)) { // attempt a write int space = appender.space();
if(!flush(duplicate)) { // attempt a write int space = appender.space();
if(!flush(reference)) { compact(); return false;
if(!flush(reference)) { compact(); return false;