Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Apr : Re: Tidtcpserver ondisconnected event

www.cryer.info
Managed Newsgroup Archive

Re: Tidtcpserver ondisconnected event

Subject:Re: Tidtcpserver ondisconnected event
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Thu, 19 Apr 2007 10:06:06

"mustafa korkmaz" <none@none.com> wrote in message
news:46267425$1@newsgroups.borland.com...

> if the client does not send any data to server in 20 seconds the
connection
> of client is closed by server.

Only if your code is not catching the resulting exception, allowing it
to escape back inside the component.  Or if the code is catching the
exception and then manually calling Disconnect() on the connection.

> Is ondisconnected event called in every situation?

OnDisconnect is only called when the worker thread that owns the
connection is being cleaned up.  So your code has to react to the
disconnect accordingly to ensure the thread is not blocked from
shutting down correctly.

> Or must I add any code to Onexecute event of Tidtcpserver for this
purpose?

Normally not.

> Athread.connection.disconnect;
> or
> Athread.connection.disconnectsocket;

I would suggest DisconnectSocket().

> On any situation if we call these methods in any where of our server
> program, is ondisconnected event of Tidtcpserver called or triggered
> by indy?

As long as your OnExecute event handler is not swallowing the
disconnect, then yes.


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive