Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Feb : Re: Detect server disconnection from the TIdCMDTCPClient

www.cryer.info
Managed Newsgroup Archive

Re: Detect server disconnection from the TIdCMDTCPClient

Subject:Re: Detect server disconnection from the TIdCMDTCPClient
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Mon, 25 Feb 2008 11:33:39

"Moore" <moore@hotmail.com> wrote in message
news:47c276f3$1@newsgroups.borland.com...

> No workaround or alternate solution???

The only way to detect disconnects with TIdCmdTCPClient is to catch
exceptions inside of your OnCommand event handlers.  Even then, that won't
catch every possible disconnect, in particular those that occur before
OnCommand is triggered.  The only other option would be to manually alter
and recompile Indy's source code yourself to have
TIdCmdTCPClientListeningThread override the virtual
TIdThread.HandleRunException() method.  Then you could expose a way for your
code to handle EIdConnClosedGracefully and other socket exceptions.


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive