[svn:p5ee] r3612 - p5ee/trunk/App-Context/lib/App/Context

[email protected]
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
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>;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.