Hello Olivier, > The NotifyDataAvailable sets a flag in an object associated to the > client socket that will then read the available bytes. But it will not > do so immediately
That's the problem. You have to read "all" available data "In" the OnDataAvailable event. If you do not then OnDataAvailable will fire again in a loop where you must receive the rest of the data, or if you set wsoNoReceiveLoop in ComponentOptions property then it is fired using a custom message handler. So the Sleep is not needed. Also it is a bad idea because if there is high speed data received and more than will be received in the event it will delay the reception of data during a time slice (10..20 millisec depending on the OS) and will grow winsock internal receive buffer, because during the Sleep the message pump is not working. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz -- 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
