This issue is not specific to Twisted. Your protocol should include confirmation that the data was received if you want to know that it was received.
The result from send() does not tell you that the data was authoritarianly received by the partner; he just says that he was queued up by the kernel for transport. From your point of view, it really doesnβt matter whether the data was queued by Twisted, or your C runtime, or your kernel, or a mid-tier intermediate switch, or a peer kernel, or something else. Maybe it's sent, maybe not. In other words, transport.write() performs additional buffering that does not support send() , ensuring that it always buffers all your bytes, while send() will only buffer some.
You absolutely must have a confirmation message at the application level if you are worried about whether your peers saw your data or not.
source share