On Oct 3, 2007, at 03:53, Arno Garrels wrote:

> CloseDelayed won't reenter the event, however to ensure that
> last data packets are received properly before the socket is
> closed call ShutDown() for a gracefull close in DataSent event
> handler.

Thanks all for the responses.  I have one more question:  I see that 
Close() ultimately calls Shutdown(1) -- so wouldn't it have the same 
effect?  I mean, the problem I'm having with Close() is that when 
ShutDown(1) is called, the buffer length is checked and it is non-zero, 
so TriggerDataAvailable() is called, but the data available is the old 
one.

I understand that I should use CloseDelayed() instead to avoid re-entry 
(and that seems to work), but my guess is that there is something else 
wrong going on that is not clearing the buffer.  I thought the buffer 
was cleared when read (ReceivedStr property), or am I wrong?

        dZ.


-- 
        DZ-Jay [TeamICS]
        http://www.overbyte.be/eng/overbyte/teamics.html

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to