From: Christian Hansen Date: Mon, 30 May 2005 05:18:28 +0000 (+0000) Subject: Use SOMAXCONN in C::E::H::Daemon X-Git-Tag: 5.7099_04~1348 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=89f2bd8df56fe92071bdb7559c9631dc316e9922;p=catagits%2FCatalyst-Runtime.git Use SOMAXCONN in C::E::H::Daemon --- diff --git a/lib/Catalyst/Engine/HTTP/Daemon.pm b/lib/Catalyst/Engine/HTTP/Daemon.pm index 8d13fe8..52a559a 100644 --- a/lib/Catalyst/Engine/HTTP/Daemon.pm +++ b/lib/Catalyst/Engine/HTTP/Daemon.pm @@ -4,6 +4,7 @@ use strict; use base 'Catalyst::Engine::HTTP::Base'; use IO::Select; +use IO::Socket; BEGIN { @@ -86,7 +87,7 @@ sub run { $SIG{'PIPE'} = 'IGNORE'; my $daemon = Catalyst::Engine::HTTP::Daemon::Catalyst->new( - Listen => 1, + Listen => SOMAXCONN, LocalPort => $port, ReuseAddr => 1, Timeout => 5 @@ -104,7 +105,7 @@ sub run { while (1) { - for my $client ( $select->can_read(0.01) ) { + for my $client ( $select->can_read(1) ) { if ( $client == $daemon ) { $client = $daemon->accept; @@ -157,7 +158,7 @@ sub run { $class->handler( $client->request, $client->response, $client ); } - for my $client ( $select->can_write(0.01) ) { + for my $client ( $select->can_write(1) ) { next unless $client->response;