|
> From: Scott Klement > > Hard to say. That's why I prefer to use an "I'm done" code of some sort > instead of shutdown(), and then have the remote side acknowedge that the > data was received. After that, it doesn't matter who closes the connection > or when, since you know the mission critical data was sent successfully. In addition to my normal bias of taking just about anything Scott says about sockets as gospel, this particular bit of advice is simply golden in any sort of asynchronous environment. It may costs you a few milliseconds in that extra turnaround, but it can save you hours or even days in debugging. Another personal bias it to try to ensure if at all possible (especially in full duplex communications) that each side is responsible for maintaining the objects it uses to receive data, and for cleaning them up after normal or abnormal terminations. When both sides use the same object, both sides should attempt cleanup after abnormal termination. Joe
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.