Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: SOAP in an NT Service

by $code or die (Deacon)
on Jan 26, 2002 at 03:39 UTC ( [id://141691]=note: print w/replies, xml ) Need Help??

in reply to SOAP in an NT Service

I had to do something similar once. I experimented with fork but it wasn't too stable. In the end, I used Win32::Process in the NT Service to create the child process (in this case the SOAP server.) Then the service was essentially just the Loop, and if a STOP command was issued, the service killed the child process. You'll probably want to give the SOAP server some kind of signal to shut down safely. Think also about preventing the child process from lingering after the service has stopped.

___ Simon Flack ($code or die)
$,=reverse'"ro_';s,$,\$,;s,$,lc ref sub{},e;$,
=~y'_"' ';eval"die";print $_,lc substr$@,0,3;

Replies are listed 'Best First'.
Re: Re: SOAP in an NT Service
by cmilfo (Hermit) on Jan 26, 2002 at 04:15 UTC
    That's a great idea! I am not normally a Win32 coder (but seem to be asked to write a lot lately).

    I perused the Win32::Process documentation. It looks like I can use the Win32::Process::KillProcess($pid, $exitcode) to stop the process before exiting. The more I think about it, this works great. I actually have two SOAP servers, so I can run them both underneath one NT Service.

    The best part is, I plan to make the project support both Win32 and Unix/Linux. Now, the only difference in the project will be the daemon piece (NT Service on Win32 and daemon on UNIX/Linux). Stop the Service/daemon and both SOAP servers stop.


    Thank you!

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://141691]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-05-19 04:09 GMT
Find Nodes?
    Voting Booth?

    No recent polls found