/** * This is used to write the packets to the writer which will * be either written to the underlying socket or queued until * such time as the socket is write ready. This will return true * if the packet has been written to the underlying transport. * * @param packet this is the packet that is the be written * * @return true if the packet has been written to the transport */ public synchronized boolean write(Packet packet) throws IOException { BufferSegment segment = compacter.build(packet); if(segment == null) { return true; } return flush(); }