Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Dec : Re: OnDisconnected event

www.cryer.info
Managed Newsgroup Archive

Re: OnDisconnected event

Subject:Re: OnDisconnected event
Posted by:"Arnau Font" (afont@nospam_really_ipssoft.com)
Date:Fri, 15 Dec 2006 16:24:18

Thanks a lot! Your dedication to this newsgroup is admirable!

Just another question, if I want to use the OnDisconnected event, could I
call Socket.Disconnect at any time with no problem? I mean, an EIdException
is catched, and I call Socket.Disconnect to execute the event, even though
the Socket is already disconnected. Is this correct?

Thanks!

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> ha escrit en el missatge dels
grups de discussió:45819bc5$1@newsgroups.borland.com...
>
> "Arnau Font" <afont@nospam_really_ipssoft.com> wrote in message
> news:458170b3$1@newsgroups.borland.com...
>
>> I've assigned a event to the OnDisconnected event to know when do
>> I lose the connection with the server.
>
> That will not work.  Indy is not an event-driven library.  The
> TIdTCPClient.OnDisconnect event is only triggered when Disconnect() is
> explicitally called.
>
>> An EIdClosedGracefully exception raises, but the event doesn't execute.
>
> As it should be.  That is not Indy is designed to work.  The event is not
> supposed to be triggered in that scenerio.
>
>> Looks like it only executes if I call Socket.Disconnect. Is this the
>> normal behaviour?
>
> Yes.
>
>
> Gambit

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive