This wasted a significant amount of my time today:
my $sock = new IO::Socket::INET (
LocalPort => 2305,
Type => SOCK_STREAM,
Proto => 'tcp',
Reuse => 1,
Listen => 10,
) or die "Could not start server: $!.\n";
while (my $child = $sock->accept) {
next if fork;
exit;
}
print "huh?";
Now, one would think that the while loop should just merrily continue along from child to child, but instead -- apparently because of a problem in IO::Socket itself, resulting from the new safe signals in perl 5.8.0 -- the SIGCHLD is improperly interpreted as a SIGALRM and the while loop ends.
I fixed by adding a label FOO: in front of the while loop, and putting a goto FOO below it. Good enough for me.
Re:Same problem here
jordan on 2003-09-23T15:02:13
You are not going crazy. I recall seeing it. Well, maybe it's mass hysteria.
I found it! We aren't going crazy! Or, at least, there's no proof, yet.