This question asks about what happens if a stream of TCP packets are not read from a socket as fast as they are received: What happens if one doesn't call POSIX's `recv` "fast enough"?
My question is however whether data that has actually been accepted and buffered by the socket has any kind of 'expiry date'? For instance if I don't call Recv
for several minutes, will that data still be there waiting? And does it have any bearing whether the socket is being sent more data in the interim?
Data that has been received and put in a socket's inbound buffer never expires, it remains in the buffer until it is read by the application, however long that takes. Any subsequent data that is received in the interim is simply appended to the end of the buffer until it fills up, at which point new data is ignored, and in the case of TCP flow control prevents the sender from sending any further data until buffer space is freed up.