in reply to Re: Running callback stops working in Win32::Daemon
in thread Running callback stops working in Win32::Daemon
Hi, Athanasius
Sorry, I'm not sure this is actually going to help.
Specifically, further on in the docs, it states:
...registers for the "running" callback it will continue to work as expected: timer expiration results in a callback to the subroutine registered for the "running" callback passing in a value of SERVICE_RUNNING.
Now, I have tested switching the running callback registration to use a timer callback registration and the actual behaviour doesn't appear to match what is defined in the documentation (in that the STATE eq SERVICE_RUNNING, regardless of whether I register a timer callback or a running callback). Instead of the STATE changing, the EVENT passed to the function is changed from SERVICE_CONTROL_RUNNING to SERVICE_CONTROL_TIMER, which kind of makes sense.
If you comment out the return and the check in callbackRunning in the example I supplied (lines 85 and 87), you'll (eventually) see that callbackRunning simply stops being called in one of the services after several hours with both copies of the service running, although if you only have one copy installed and running, it will just keep running.
I'll test it now with a timer callback registered instead of a running callback and let you know how it goes.
Thanks for your help so far though, it is very much appreciated.
|
|---|