Loading ...
Sorry, an error occurred while loading the content.

effectivily shutdown a daemon (SOAP::Transport::TCP::Server) under forked proc?

Expand Messages
  • bcase@telus.net
    how do i effectivily shutdown a daemon (SOAP::Transport::TCP::Server) under a forked process. your help is appreciated. Jeremy. ################### Loop(); sub
    Message 1 of 1 , Oct 18, 2001
    • 0 Attachment
      how do i effectivily shutdown a daemon (SOAP::Transport::TCP::Server)
      under a forked process.


      your help is appreciated.

      Jeremy.

      ###################
      Loop();

      sub Loop {
      print "Prompt>>";
      chomp( my $in = <> );
      if( $in eq "start") {
      if (($PID = fork()) == 0) {
      init();
      }elsif($PID != 0){
      print "Soap Service Started\n";
      }
      Loop();
      }elsif($in eq "close") {
      if($PID == 0){
      $daemon->close;
      }elsif($PID != 0){
      $daemon->shutdown(2);
      undef $daemon;
      print "Soap Service Stopped\n";
      }
      Loop();
      }else{
      Loop();
      }
      }


      sub init() {
      $daemon = SOAP::Transport::TCP::Server
      -> new (LocalPort => 8080, Listen => 5, Reuse
      => 1)
      -> dispatch_to('info');

      $daemon->handle;
      }


      package info;

      sub about {
      return "Based on my Module";
      }

      1;
    Your message has been successfully submitted and would be delivered to recipients shortly.