News for hackers. Stuff that matters.
Re:TCP is UNreliable by BetaCygni on Friday August 16, 2013 @11:33AM (#6224614)
> after you've sent data and received no application-layer acknowledgement

This would be the most robust fix. Have the server return "OK" or something after it has processed the data. It could have silently crashed but still accept connections.

Re:TCP is UNreliable by tptacek on Friday August 16, 2013 @11:35AM (#6224633)
I'm not sure I see how this is more robust than simply checking to make sure you had an orderly close. The orderly close check should also catch the case where the application crashes after its TCP stack has received the data but before the application processed it.

I'm not saying there's never any point to application acknowledgements; look at any careful SMTP server implementation for a study of how to handle these problems. TCP can promise a reliable transport but obviously not a reliable disk.

Re:TCP is UNreliable by noselasd on Friday August 16, 2013 @12:01PM (#6224822)
Though, the contract you have with TCP , is between TCP at your end and the TCP at the peer, not that it also have delivered the data to the application of the peer.

If the peer crashes just as it read() the data, but didn't process it, it will look just as a normal clean close on the sender machine if there arn't more data laying around in the TCP buffers.

Re:TCP is UNreliable by tptacek on Friday August 16, 2013 @12:12PM (#6224909)
To be clear, you're talking about the case where the application dequeues the data from its receive queue and then crashes. If you close a socket without reading queued data, you get an RST.