> 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.
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.
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.
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.