> Send off the data and close the socket. If there's data still pending to be read, this will cause a RST, I think.
Um, yes? That's how TCP has been universally implemented for more than 30 years. See [0], 2.17 for discussion.
Um, yes? That's how TCP has been universally implemented for more than 30 years. See [0], 2.17 for discussion.
That's not what's happening here. The server is closing the socket when there's data from the client that it hasn't read.
If the client does a read() after the RST gets there, any data in the receive window is gone, any packets that might have been dropped and need to be resent are gone, etc.