Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Oct : Re: TIdTCPServer not shutting down

www.cryer.info
Managed Newsgroup Archive

Re: TIdTCPServer not shutting down

Subject:Re: TIdTCPServer not shutting down
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Wed, 4 Oct 2006 15:28:52

"Roberto Meneghini" <rmeneghini@separationsystems.com> wrote in message
news:45241979@newsgroups.borland.com...

> I'm writing a Client/Server application using INDY10 for Delphi.NET.
> I've noticed (using the Task Manager) that if I close the server
> application while a client is still connected, the server process stays
loaded.

Without seeing your actual code, my guess is that you ar deadlocking the
server's threads.  When deactivating the server, it waits for the client
threads to terminate.  If the threads are doing something that interacts
with the thread that is shutting down the server, a deadlock occurs.

> However, this does not happen if the client(s) disconnect before
> closing the server.

Because the client threads are already gone by the time the server goes to
wait on them, so it has nothing to wait on and can exit immediately.

> My guess is that a thread is still active. Is there a way to force the
> server to shutdown all the active connections.

The server already does exactly that before then waiting on the threads to
terminate.  But disconnecting the connections is useless of the threads are
deadlocked.


Gambit

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive