title: Data remains in SslStream after read
body: <p>I'm developing a peer-to-peer software, that uses .net's SslStream for secure communication.</p>
  
  <p>I use BeginRead() and EndRead() to read the data from the stream asynchronously. (Don't mind the weird callback method too much.. it's from a framework I have to work with right now)</p>
  
  <pre><code>while(Config.State &lt; Config.State.Exit)
  {
  
      association.SslStream.BeginRead(
                  InputBuffer,
                  InputBufferOffset,
                  InputBuffer.Length - InputBufferOffset,
                  iarPort.Post,
                  null);
  
      yield return Arbiter.Receive(false, iarPort, iar =&gt;
              {
                  try
                  {
                      bytesReceived = association.SslStream.EndRead(iar);
                  }
                  catch
                  {
                      bytesReceived = 0;
                  }
              });
  
  // process data
  
  }
  </code></pre>
  
  <p>The client will process the received data and start reading again. If the remote client has not sent new data yet, the receiving client will read the old data again. So the data remains in the SslStream after it was read.</p>
  
  <p>Is there a way to tell the client that he has already read this data?</p>