Angus Robertson - Magenta Systems Ltd wrote:
>>> Waiting for all sockets to close cleanly may be necessary before
>>> terminating an application, to ensure continuously streamed data
>>> is not lost.
>> I do not see a reason why one must wait in a loop processing
>> messages with calls to sleep()in order to achieve that, that's
>> often a hint to bad design and should be avoided.
> I would not use sleep in such a loop, but if Windows is trying to
> close a service to reboot, you do need to loop for a few seconds
> while blocking the close down request.

Indeed that would be a case.
However a call to ShutDown(SD_BOTH) at that moment would likely 
raise a socket error at once if any subsequent attempt is made to
send or receive something.   

Arno Garrels

To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to