Author: spadkins
Date: Mon Mar  6 08:16:36 2006
New Revision: 3612

Modified:
   p5ee/trunk/App-Context/lib/App/Context/Server.pm

Log:
try to allow SIGCHLD to wake up the sleep

Modified: p5ee/trunk/App-Context/lib/App/Context/Server.pm
==============================================================================
--- p5ee/trunk/App-Context/lib/App/Context/Server.pm    (original)
+++ p5ee/trunk/App-Context/lib/App/Context/Server.pm    Mon Mar  6 08:16:36 2006
@@ -133,6 +133,7 @@
     $SIG{INT}  = sub { $self->log("Caught Signal: @_ (quitting)\n") if 
($verbose); $quit = 1; };
     $SIG{QUIT} = sub { $self->log("Caught Signal: @_ (quitting)\n") if 
($verbose); $quit = 1; };
     $SIG{TERM} = sub { $self->log("Caught Signal: @_ (quitting)\n") if 
($verbose); $quit = 1; };
+    $SIG{CHLD} = "DEFAULT";
 
     my $default_sleep_interval = 15*60;
 
@@ -177,7 +178,9 @@
                 # TODO: if (sleep_interval == 0), use select() to see if 
anyone is waiting, else ...
                 $self->log("Sleeping on socket: timeout($sleep_interval)\n") 
if ($verbose >= 3);
                 $listen_socket->timeout($sleep_interval);
+                $SIG{CHLD}  = sub { $self->log("Caught Signal: @_\n") if 
($verbose); };
                 $connection_socket = $listen_socket->accept();
+                $SIG{CHLD}  = "DEFAULT";
                 if ($connection_socket) {
                     $connection_socket->autoflush(1);
                     $msg = <$connection_socket>;

Reply via email to