Board index » delphi » TService Disappearing When COM Client Count Goes To Zero

TService Disappearing When COM Client Count Goes To Zero

I have an NT service built with starting from the Delphi 5 "New Service
Application" selection.  The service acts as a COM server, following Binh
Ly's "DCOMHelloWorldService" example.  Everything appears to be working
fine...except that judging by the behavior of some test COM clients I have
put together, the TService descendent in the service application is
destroyed when the last COM client disappears. (However, the service
application does not show as "stopped" in the services control panel applet
after the last COM client goes away.)

   This is not the behavior we would like, since ultimately we want the
service to continue doing some other things irrespective of wheter all the
clients have signed off or not.  Is what I am seeing normal behavior?  If
it's not, what should I be looking to change?  If it is normal behavior, is
there a way of changing that behavior?

D5 Upd 1, NT4 SP 5.

 

Re:TService Disappearing When COM Client Count Goes To Zero


This is because the COM library and the service library were not designed to
go together, without extra work. You might need to hook into
TComServ.OnLastRelease and do more work there to notify your service of its
status (and vice versa). Otherwise, you might want to look into Alexey
Dynnikov's SvCom components.

--
have fun
Binh Ly
http://www.techvanguards.com

"L. S. Lichtmann" <condaptr...@earthlink.net> wrote in message
news:3b325b94$1_2@dnews...

Quote
> I have an NT service built with starting from the Delphi 5 "New Service
> Application" selection.  The service acts as a COM server, following Binh
> Ly's "DCOMHelloWorldService" example.  Everything appears to be working
> fine...except that judging by the behavior of some test COM clients I have
> put together, the TService descendent in the service application is
> destroyed when the last COM client disappears. (However, the service
> application does not show as "stopped" in the services control panel
applet
> after the last COM client goes away.)

Re:TService Disappearing When COM Client Count Goes To Zero


Thank you Binh!  Assigning ComServer.OnLastRelease to something suitable has
done the trick.

Other Threads