> > Close() ultimately calls Shutdown(1) -- so wouldn't it have the same > > effect? > > As I recall not exacly the same. Close calls Shutdown(1) and close the > socket. If you call Shutdown(1) the socket will not be immediatly close, > but if there is still some data it will be send, and the other end will > tell it is ready to close when receiving the data. Then the socket will > be closed by winsock (and OnSessionClosed is then called).
Aha! Ok, I understand now. I'll look deeper in the TWSocket code to understand it better, but I get the picture. > > I thought the buffer > > was cleared when read (ReceivedStr property), or am I wrong? > > Yes it is. If OnDataAvailable is called when you call close (with some > data) then the other end has send some data, or there is somewhere a > re-entrance problem (somewhere calling the message pump?). And this perhaps is the problem, because it seems to be re-entering without receiving new data. I'll check my code to see if I'm stupidly calling the message pump somewhere else (I probably am). Thanks! -dZ. -- 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
