in reply to Max Clients on a Perl Server

Here's some code for the forking server (not prefork), I'll try to wack out some code using IO::Select shortly....
#/usr/bin/perl use IO::Socket; $SIG{'CHLD'} = \&REAPER; #Set up our signal handler $sock = IO::Socket::INET->new(LocalHost => '127.0.0.1', LocalPort => 9 +999, Proto => 'tcp', Listen => 10, Reuse => 1) || die("Couldn't create socket: $ +!\n"); while($client = $sock->accept()) { #our loop to take the connections $pid = fork(); if($pid == 0) { #Child process, do work while(defined($line = <$client>)) { print($client->peerhost, ": said $line\n"); } } } close($sock); sub REAPER { 1 until (waitpid(-1,WNOHANG) == -1); #We do it this way to avoid chil +dren #dying before our signal handler + gets #reinstalled $SIG{'CHLD'} = \&REAPER; }