Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 May : TServerSocket - Still Need Answers

www.cryer.info
Managed Newsgroup Archive

TServerSocket - Still Need Answers

Subject:TServerSocket - Still Need Answers
Posted by:"Graham Powell" (grah..@deephaven.co.uk)
Date:Thu, 19 May 2005 10:56:58

In the OnClientRead event I still don't know why I have to do multiple
reads.

Either Socket.ReceiveText or Socket.ReceiveBuf have to be called repeatedly
until there is no more data. In the latter case even if Socket.ReceiveLen is
used to determine how much data is available, this has to be done until
ReceiveLen returns 0. A single call to either of these functions can result
in TCP/IP packets being lost.

I only have this scenario when one particular client sends data to my Server
Socket. I have tried sending data from my Client simulator program with
varying amounts of data in each SendText call. This never provokes the
problem, with multiple reads or not.

So is there anything this particular client can be doing in their send
mechanism which would cause the Server Socket to have to implement multiple
reads within the OnClientRead event?

As this is a non-blocking Server socket, could this problem be explained by
the client not checking for the WSAEWOULDBLOCK error from the
WsaGetLastError function?

Thanks for any help
  Graham

Replies:

www.cryer.info
Managed Newsgroup Archive