Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Sep : Re: Indy 9 - not detecting disconnect over VPN
| Subject: | Re: Indy 9 - not detecting disconnect over VPN |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Thu, 20 Sep 2007 10:52:36 |
<user@domain.invalid> wrote in message
news:46f2b09f$1@newsgroups.borland.com...
> I am also sending a 0 length string if the socket is idle. On
> the server side, how do I catch (in order to reset my timeout)
> the 0 length string?
What I was referring to earlier was to have the server send the 0-length
string to the client when idle (since the client is the one sitting in a
reading loop). That way, your loop could do something like the following:
while (not Terminated) and client.connected do begin
Count := Client.ReadInteger;
if Count = 0 then Continue; // <-- here
s := Client.ReadString(Count);
...
end;
> FWIW, I am using command handlers
Then have the client send an actual command to the server periodically that
the server responds to.
Gambit