title: TCP sockets: Where does incoming data go after ack(leaves tcp read buffer) but before read()/recv()?
body: <p>If i have a TCP connection that transfers data at 200 KB/sec but i only <code>read()</code>/<code>recv()</code> from the socket once a second, where are those 200 KB of data stored in the meanwhile?</p>
  
  <p>As much as I know, data leaves the TCP socket's read buffer after an ack gets sent to the sender, and it's too small anyways to hold 200KB of data, where does it wait in the meanwhile until it can be <code>read()</code>/<code>recv()</code> by my client?</p>
  
  <p>Thanks!!</p>
  
  <p>The following answer claims data leaves the TCP read buffer as soon as it is ACK'ed, before being read()/recv()d:</p>
  
  <p><a href="https://stackoverflow.com/a/12934115/2378033">https://stackoverflow.com/a/12934115/2378033</a></p>
  
  <p>"The size of the receiver's socket receive buffer determines how much data can be in flight without acknowledgement"</p>
  
  <p>Could it be that my assumption is wrong and the data gets ACK'd only after it is read()/recv()d by the userspace program?</p>