Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Oct : Re: Best method of keep-alive?
| Subject: | Re: Best method of keep-alive? |
| Posted by: | "Jamie Dale" (j.da..@turboz.net) |
| Date: | Tue, 3 Oct 2006 19:00:01 |
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:45229a2f@newsgroups.borland.com...
>
> "Jamie Dale" <j.dale@turboz.net> wrote in message
> news:452286c3@newsgroups.borland.com...
>
>> I'm using Indy 8. ReadLnTimedOut doesn't exist. Do you have
>> any other ideas please?
>
> Upgrade to Indy 9 or 10. Seriously. Indy 8 is no longer supported.
I know you'd like me to upgrade but V10 seems to be the downfall of Indy and
V9 I continue to see bug reports for on the newsgroups. V8 despite it's age
doesn't seem to be raising many issues here apart from my lack of knowledge.
Sorry if I sound arrogant with this attitude but after my experience with
Indy 10 for .NET and the compilation errors I decided to wait until the Indy
pit crew manage to put together a full proper release which has been zipped.
Not a live copy which they work on and may not work.
>
>> Should my client set a timer to expect a response within?
>
> The ReadTimeout already handles that for you. If you send a command, and
> the response does not arrive in a timely manner, then disconnect when the
> timeout elapses. 'PING' is just another command like any other, just one
> that you send at regular intervals during idle periods.
>
>> Seeing as I'm now going to do this from the client end, I'm supposing
>> that my client should activate a timer when it sends 'ping' and then
>> close the connection if the timer expires before a reply is received?
>
> The only time you would need to use a timer in this situation is if you
> are
> handling responses asynchronous, such as in a separate reader thread.
> Otherwise, if you are reading the response in the same thread that sends a
> command, then the ReadTimeout is sufficient.
Yes but I don't have ReadTimeOut.
>> I also noticed that the ReadLn procedure seems to be the same
>> in TIdTCPClient.
>
> TIdTCPClient derives from TIdTCPConnection. ReadLn() is implemented in
> TIdTCPConnection, not in TIdTCPClient.
Bearing in mind I am still using V8.... I use IdTCPClient1.ReadLn(). I'm
assuming it works the same way as IdTCPServer's AThread.Connection.ReadLn()
?
Thanks