Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Sep : Re: Converting From TClientSocket

www.cryer.info
Managed Newsgroup Archive

Re: Converting From TClientSocket

Subject:Re: Converting From TClientSocket
Posted by:"Jack Mason" (jackmas..@mindspring.com)
Date:Mon, 3 Sep 2007 23:39:40

You were right on the byte count, it was the total bytes following the
response header.  However, the code you suggested exhibits two different
behaviors:

As proposed, the read error still occurs.  If I insert a delay of at
least 2 seconds before the first readstring, the readstring works and
gets the first character of the following data (which it is supposed to
do).  However, the second read, while appearing to be successful,
returns with a length of zero (but no error).

The documentation seems to say the read will delay until the data
arrives and that a readstring will return 'n' bytes from an internal
buffer with additional 'x' bytes on the next readstring if there is data
present.

The blocking action of the socket is fine, but it appears it may need to
be in a thread to work properly?

Any ideas?

Here is the actual info if it is any help to you.

Host:  nashville.ingrambook.com
Port: 5501
Request: 112345677654321PASSWORDISTK2000139780618610037

The response will have a 33 byte header with the first 28 bytes matching
the first 28 bytes of the 'Request' then a 5 byte byte count, right
justified with leading zeroes. The byte count will be the number of
additional bytes that have been transmitted.

Thanks

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive