Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Oct : Re: Closing down a Indy 9/10 IdTCPServer

www.cryer.info
Managed Newsgroup Archive

Re: Closing down a Indy 9/10 IdTCPServer

Subject:Re: Closing down a Indy 9/10 IdTCPServer
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Sat, 21 Oct 2006 20:54:32

"Matt Mazanec" <tsusai@gmail.com> wrote in message
news:453ab513$1@newsgroups.borland.com...

> Ok so if I am to do just Active := false (Indy 9), how would I set it up
> to
> handle the TimeOut exception Indy will sometimes do because I have no
> idea.

The only way you can get an EIdTerminateThreadTimeout exception in the first
place when shutting down the server is if your client threads are taking too
long to terminate.  Usually that means that your event handlers are
performing lengthy operations that don't pay attention to the socket's state
or the thread's Terminated property.  Or worse (and more likely) that they
are performing synchronized operations while the server is shutting down.
Shutting down the server from within the main thread, while an event handler
calls the TThread.Synchronize() method at the same time, leads to a deadlock
situation.  The main thread is blocked waiting on the server to deactivate,
so it can't process synchronize requests, but the client thread is blocked
on the Synchronize() and can't terminate the thread that the server is
waiting on.


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive