info2004 wrote: > Arno, > Arno Garrels wrote: >> info2004 wrote: >> When the server closes the connection OnSessionClosed triggers. >> In order to check whether component's internal send buffer is empty >> you have property BufferedByteCount. >> >> If your application has to close the connection when all data >> has been sent, you should use method ShutDown(1) from the OnDataSent >> event, this makes sure the receiver will receive everything. > > I think that we are at cross purposes here. The OnDataSent event > looks like it does not fire (sometimes) if the far end (server) > closes the connection. Is this true?
That's true. Be aware that OnDataSent triggers when TWSocket's internal send buffer is empty means data from the internal send buffer has been copied into the winsock buffer. It doesn't signal that the receiver received those bytes yet. It just signals that they are "on the way". > > The server gets the data, then closes the connection, and at my > sending end if I solely wait for OnDataSent, sometimes it does not > happen, and I time out. I think this is impossible, see above. -- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be