title: Flush the buffer after receiving packets
body: <p>I am using the below code for receiving TCP packets from a tool.</p>
  
  <pre><code>while(socket.Connected)
  {
    var buffer = new byte[4096];
    int receiveLength = socket.Receive(buffer);
    if (receiveLength != 0)
    {
  
       byte[] response= new byte[4096];
       ProcessPacketData(buffer, out response);
  
       socket.Send(resposne);
    }
  //Sleep(100);
  }
  </code></pre>
  
  <p>When Using this code, the problem that I am facing is,for socket.Receive() function the buffer doesn't getting flushed. Every time, when calling the socket.Receive(buffer), the new data packets are getting appended with the old packets contained in the buffer. I want to avoid that situation. Is there any solution for this?</p>