Catalyst::Engine::HTTP try select
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / HTTP.pm
index 37be240..35c3c44 100644 (file)
@@ -47,6 +47,7 @@ sub run {
         Listen    => SOMAXCONN,
         LocalPort => $port,
         ReuseAddr => 1,
+        Timeout   => .1,
         Type      => SOCK_STREAM,
     );
 
@@ -58,7 +59,9 @@ sub run {
 
     printf( "You can connect to your server at %s\n", $base );
 
-    while ( my $connection = $daemon->accept ) {
+    while ( 1 ) {
+
+        my $connection = $daemon->accept or next;
 
         while ( my $request = $connection->get_request ) {