/** * This method is used to flush all of the queued packets to * the client. This method will block 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(); if(!done) { flusher.flush(); } }
/** * This method is used to deliver the provided packet of bytes to * the underlying transport. This will not modify the data that * is to be written, this will simply queue the packets in the * order that they are provided. * * @param packet this is the array of bytes to send to the client */ public void write(Packet packet) throws IOException { boolean done = writer.write(packet); if(!done) { flusher.flush(); } }