Re: [twsocket] Multiple OnDataAvailable calls when no data to read

2008-12-01 Thread Arno Garrels
Anton Sviridov wrote: 1) What's the meainng of SendBinString in Server, it is never used? It's never used. What for do you use PutDataInSendBuffer? It puts data into the send buffer without actually sending the data, it's not required, however saves on internal call to socket.send. 2) I

Re: [twsocket] Multiple OnDataAvailable calls when no data to read

2008-11-26 Thread Wilfried Mestdagh
Hello Anton, *embarrassed* how these two statements combine? Why several Receives should cause troubles? it is by design, only 1 receive call in the event. And another question. Is TWSocket.RcvdCount value reliable, i.e. if it = 0, then there is really no data in the socket? Microsoft

Re: [twsocket] Multiple OnDataAvailable calls when no data to read

2008-11-25 Thread Wilfried Mestdagh
Hello Anton, Don't worry. You don't have to do anything on the 'would block' winsock error. TWSocket deals with it. when OnDataAvailable fires, just try to receive all data. When Receive return 0 or -1 then just exit the event handler. -1 is error (don't worry), and 0 is if the peer has closed.

Re: [twsocket] Multiple OnDataAvailable calls when no data to read

2008-11-25 Thread Arno Garrels
Wilfried Mestdagh wrote: Hello Anton, Don't worry. You don't have to do anything on the 'would block' winsock error. TWSocket deals with it. when OnDataAvailable fires, just try to receive all data. When Receive return 0 or -1 then just exit the event handler. -1 is error (don't

Re: [twsocket] Multiple OnDataAvailable calls when no data to read

2008-11-25 Thread Arno Garrels
Anton Sviridov wrote: Hello, Wilfried! You have calmed me :) Arno Garrels [TeamICS] wrote: As I understand the OP calls receive multiple times in OnDataAvailable which is not a good idea. So, each Recv launches one more OnDataAvail in the future? AFAIK no, only if you do not read all