go ahead... be a heretic | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Thanks a lot for your replies.
Sorry, my previous answer was ambiguous: $pid is undefined in the handle_request () method of MyWebServer, but it is correctly set to something like "-1470" in test.pl. In fact, writing this in test.pl effectively stops the server immediately:
But in order to execute this instruction in response to some HTTP request, (I think) I need to call it from within a handler in MyWebServer. I find that the following:effectively stops the server if it is added anywhere in MyWebServer.pm's "body" (e.g. at the first line), but not if it is added in the handle_request() method. I've also tried tilly's suggestion to have test.pl write the PID in a file, then have handle_request() read this file. It does succeed at passing the PID, and I do not get the "Can't kill a non-numeric process ID" message anymore, however the call to kill does not stop the server in this case. In reply to Re^6: Stopping an HTTP::Server::Simple server
by textual
|
|