title: What happens if I try to send an empty UDP packet through a DatagramChannel but the underling socket buffer is full?
body: <p>I must be missing something but how can I tell if my empty UDP packet was sent through the DatagramChannel send method? If it returns ZERO bytes, does it mean my empty packet was sent or does it mean the underlying socket buffer was full?</p>
  
  <p>From the API:</p>
  
  <blockquote>
    <p>The number of bytes sent, which will be either the number of bytes
    that were remaining in the source buffer when this method was invoked
    or, if this channel is non-blocking, may be zero if there was
    insufficient room for the datagram in the underlying output buffer.</p>
  </blockquote>
  
  <p><a href="http://docs.oracle.com/javase/7/docs/api/java/nio/channels/DatagramChannel.html#send(java.nio.ByteBuffer,%20java.net.SocketAddress)" rel="nofollow">http://docs.oracle.com/javase/7/docs/api/java/nio/channels/DatagramChannel.html#send(java.nio.ByteBuffer,%20java.net.SocketAddress)</a></p>