Shutdown TidHTTPServer when last response served

Giganews Newsgroups
Subject: Shutdown TidHTTPServer when last response served
Posted by:  Eric Carlson (eric.removethis.carlson@group-technical-andthis.com)
Date: Fri, 5 May 2006

D7 Ent/Latest Indy 9. I have a form with the server on and the user could
close it at any time. When they do, I send a message to another window
(service based) which activates its server. This works most of the time, but
I'm getting some timing funnies - sometimes the service version never
starts.

In the OnClose method of the first form, I set active := false and do the
SendMessage. Could it be the server doesn't close because its servicing some
requests? In other words, can I count the number of currently serviced
requests (threads?) and only continue the handover if they are zero? Thanks.

Replies