in reply to Catching a signal causes my socket server to die

Using a SIGALRM handler seems to not work because it causes accept() to return.
while() { my $ret=accept($client,$server); next if (not defined($ret)); . . }
Instead of using accept inside the parenthesis, use it inside the loop and continue if succeeded. It worked for me.

Replies are listed 'Best First'.
Re^2: Catching a signal causes my socket server to die
by ikegami (Patriarch) on Jan 07, 2009 at 09:26 UTC
    That will result in real errors causing the application to enter a tight, infinite loop.