Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Sep : Re: Indy 9 - not detecting disconnect over VPN

www.cryer.info
Managed Newsgroup Archive

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:Wed, 19 Sep 2007 12:53:03

<user@domain.invalid> wrote in message
news:46f169ed$1@newsgroups.borland.com...

> The client issues
>        Count := Client.readinteger;
>
> which blocks while it waits for data.  The server disconnects
> but we are still in this code.  (verified with debug statements such as:

Like I said earlier, for that to happen, the OS itself is not reporting the
disconnect at the API level.  Which would suggest that the disconnect is not
being done gracefully on the server end.

The only way to detect abnormal disconnects is to either way for the OS ti
time out internally (which can take up to several hours), or else implement
your own keep-alive system in your packets.  Given the nature of your
current protocol, that is not going to be easy to implement, either.  So you
are left with only 1 option - set the ReadTimeout on the client, and don;t
allow the server to go idle for periods of time that are longer than that
timeout (or at least have it send a 0-length string periodically - that
could act as your keep-alive).


Gambit

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive