in reply to Forking HTTP Daemon

The problem is that the SIGCHLD is interrupting the accept() call. To fix:
use Errno qw(EINTR); ... while (1) { $client = $socket->accept; if (!$client) { next if $! == EINTR; die "Error on accept: $!\n"; }
or equivalent

Updated per request:
http://archive.develooper.com/perl5-porters@perl.org/msg85068.html
http://www.gnu.org/manual/glibc-2.2.5/html_node/Interrupted-Primitives.html

This is also one of the examples given in Worse is Better

Replies are listed 'Best First'.
Re: Re: Forking HTTP Daemon
by Zola (Initiate) on Mar 19, 2003 at 20:48 UTC
    Much appreciated,
    Thanks
    Matt
Re: Re: Forking HTTP Daemon
by Anonymous Monk on Apr 30, 2004 at 19:06 UTC