title: What to do when Jetty EndPoint.flush(ByteBuffer b) returns false?
body: <p>i'm using Jetty 9 EndPoint for the first time.<br>
  But i'm stuck as to how to use the <strong>EndPoint.flush(ByteBuffer)</strong> method returncode.<br>
  Should i loop indefinitly until the call succeeds ? </p>
  
  <p>Javadoc just says</p>
  
  <blockquote>
    <p><em>Returns:</em>
    True IFF all the buffers have been consumed and the endpoint has flushed the data to its destination (ie is not buffering any data).</p>
  </blockquote>
  
  <p>By the way, the instance i'm calling on is of type <em>SslConnection$DecryptedEndPoint</em></p>
  
  <p>Any insight is appreciated, since i can't find any documentation as to why SocketEndpoint is discouraged and SelectChannelEndpoint is preferred.</p>
  
  <hr>
  
  <p>A bit offtopic but anyway;
  To my surprise i found this in <strong><em>NetworkTrafficSelectChannelEndPoint</em></strong>:<br>
  the operation |=  is used instead of &amp;= (found in jetty-all-9.0.3.v20130506-sources.jar)  </p>
  
  <pre><code>@Override
  public boolean flush(ByteBuffer... buffers) throws IOException
  {
      boolean flushed=true;
      for (ByteBuffer b : buffers)
      {
          if (b.hasRemaining())
          {
              int position = b.position();
              flushed|=super.flush(b); // &lt;&lt;-- shouldn't it be &amp;=
              int l=b.position()-position;
              notifyOutgoing(b, position, l);
              if (!flushed)
                  break;
          }
      }
      return flushed;
  }
  </code></pre>