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:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Tue, 4 Sep 2007 09:51:38

"Jack Mason" <jackmason@mindspring.com> wrote in message
news:46dd8590@newsgroups.borland.com...

>      sleep(2000);

Get rid of that.  It is not necessary.  If you leave the ReadTimeout
property at its default value, ReadString() will block until either data
arrives or a socket error occurs.

> I haven't (to my knowledge) changed the read timeout value,
> but if I remove the "sleep(2000)" the program gets an
> immediate "read timeout".

Then something else is happening outside of Indy to interfer with its
reading.  The default ReadTimeout is to wait indefinately for data to
arrive.  Indy automatically sleeps internally as needed until that condition
is met.

> Perhaps I need to set the read timeout to be about 5 seconds?

No, you should leave it set to its default value.


Gambit

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive