Is there a way, in Tornado to receive a callback when a write has been ACKed by the client?
My application is delivering certain critical messages to clients, using web.asynchronous and in the event of a network issue, it’s possible for my application to call finish() and have the client never actually receive any data. Waiting for the TCP ACK to come back would be all the confirmation I need that the client actually received the data, before I mark the data as received. However, I see no way to do this within the tornado framework.
Should I start digging into the internals of tornado.netutil and tornado.iostream to do this, or am I missing something?
I realize that I could have the client do a subsequent HTTP request confirming that it got the message, but changing the client is rather difficult at this point, and bandwidth is expensive for the client in some cases.
It turns out that the callback for flush() does exactly this.
So you may do the following