Perl forked socket server, stops accepting connections when a client disconnects
When using the following, but also when using similar code with IO::Socket::INET, I have problems with accepting new connections, once a client has disconnected. It seems the parent stops forking new children, until all previous children have ended/disconnected. The connection is accepted though. Does anyone have an idea what I'm doing wrong. #!/usr/bin/perl -w use Socket; use POSIX qw(:sys_wait_h); sub REAPER { 1 until (-1 == waitpid(-1, WNOHANG)); $SIG{CHLD} = \&REAPER; } $SIG{CHLD} = \&REAPER; $server_port=1977; socket(SERVER, PF_INET, SOCK_STREAM, getprotobyname('tcp')); setsockopt(SERVER,