code: @Override
  	public boolean appendOutgoingData()
  	{
  		while (outputBuffer.remaining() > 0)
  		{
  			if (packetOutputBuffer.size() == 0)
  			{
  				if (sendQueue.size() == 0)
  					return true; // No more packet to send
  				
  				if (outputBuffer.remaining() < 4) // packet_size = sizeof(int) = 4
  					return true; // Not enough space to proceed
  				
  				// Write packet size
  				if (!serializePacket(sendQueue.getFirst(),packetOutputBuffer))
  					return false; // Invalid packet
  				outputBuffer.putInt(packetOutputBuffer.size());
  				currentOutputOffset = 0;
  			}
  			else
  			{
  				int writeAmount = Math.min(outputBuffer.remaining(),packetOutputBuffer.size() - currentOutputOffset);
  				packetOutputBuffer.putTo(outputBuffer, currentOutputOffset, writeAmount);
  				currentOutputOffset += writeAmount;
  				
  				// Packet completly sent ?
  				if (currentOutputOffset == packetOutputBuffer.size())
  				{
  					AbstractPacket sentPacket;
  					synchronized (sendQueue)
  					{
  						sentPacket = sendQueue.removeFirst();
  					}
  					packetOutputBuffer.clear();
  					
  					if (listener != null)
  						listener.packetSent(sentPacket);
  				}
  			}
  		}
  		return true;
  	}
docs: /* (non-Javadoc)
  @see net.timewalker.ffmq4.transport.tcp.nio.NIOClientSocketHandler#appendOutgoingData()