Background:
We have a client/server application that uses a persistent connection to the server.
Benchmarks show that it is many times faster to use an already open connection rather than spend significant time (2.5 seconds) setting up a new connection (crypto).
Unfortunately, the old connection may be stale.
Is there a way to wait for the system-level result of sending a message [either ACK or error]?
Waiting for read and then getting the end of stream causes confusion.
I know the message might be broken up into packets. It would suit my purposes equally well to know either if any part of the message was acked or if all of it was. The interesting problem here is stale connection.