Soap Daemon as Windows Service
- I've written a SOAP HTTP server daemon using SOAP::Lite. It works great. I can connect to
it fine across the network when running it at the command line.
I've written Windows Services before using Roth's Win32::Daemon module. They work fine
Now I want to combine them so I will have a SOAP HTTP server damon running as a
Here's my problem. Normally you put the code that you want to repeat forever in the
Running section of the Win32 service and a sleep(1) in there so that it has time to
communicate with the Windows Service Manager. In the case of the SOAP daemon there is
no explicit infinite loop since you just call $daemon->handle and the loop is handled
internally. This is a problem for a Windows service because if you don't release a slice of
the CPU to the Windows service manager every once in awhile, then the service can't
respond to the state changes. In short, I can't stop my Windows service without rebooting.
How do I make my SOAP HTTP server daemon run as a Windows Service and respond
correctly to Windows service manager?