Service "events" (Service Control Requests) are sent from the Service Control Manager to the main thread of the service (through a named pipe), where a control handler should be registered. This control handler function is executed on receipt of the Service Control Request. The application itself runs in a separate thread (known as "service main"). I honestly can't see how SrvAny could provide that functionality to a single-threaded non-service app. It probably just provides scafolding. There is no way it would use signals anyhow - they are UNIX architecture and poorly implemented on Windows (to conform to ISO C standards, no more).
From the SrvAny documentation:
"WARNING:
When the service is stopped, it terminates the application via the WIN32 TerminateProcess() API: this is a drastic way to end an application. For example, it would not allow the application to prompt the user to save changes. Therefore, it is recommended to close the application BEFORE stopping the service."
Which kinda confirms my guesses above.
Update: I came across a 5.10 version of Win32::Daemon. Can't say I have tried it, but it might help. See the link and explaination
here
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.