--- loncom/Attic/lonc 2003/02/03 18:03:52 1.45 +++ loncom/Attic/lonc 2003/02/24 19:56:30 1.47 @@ -5,7 +5,7 @@ # provides persistent TCP connections to the other servers in the network # through multiplexed domain sockets # -# $Id: lonc,v 1.45 2003/02/03 18:03:52 harris41 Exp $ +# $Id: lonc,v 1.47 2003/02/24 19:56:30 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -325,7 +325,7 @@ tie %ready, 'Tie::RefHash'; # Main loop: check reads/accepts, check writes, check ready to process -status("Main loop"); +status("Main loop $conserver"); while (1) { my $client; my $rv; @@ -365,6 +365,8 @@ while (1) { } $servers{$client->fileno} = $client; nonblock($client); + $client->sockopt(SO_KEEPALIVE, 1);# Enable monitoring of + # connection liveness. } HandleInput($infdset, \%servers, \%inbuffer, \%outbuffer, \%ready); HandleOutput($outfdset, \%servers, \%outbuffer, \%inbuffer, @@ -700,7 +702,7 @@ sub openremote { my $conserver=shift; -&status("Opening TCP"); +&status("Opening TCP $conserver"); my $st=120+int(rand(240)); # Sleep before opening: unless ( @@ -740,7 +742,7 @@ if ($answer ne 'ok') { } sleep 5; -&status("Ponging"); +&status("Ponging $conserver"); print $remotesock "pong\n"; $answer=<$remotesock>; chomp($answer); @@ -973,12 +975,12 @@ sub londtransaction { alarm(0); }; } else { - if($DEBUG) { - &logthis("Timeout on send in londtransaction"); - } + &logthis("lonc - suiciding on send Timeout"); + die("lonc - suiciding on send Timeout"); } - if( ($@ =~ /timeout/) && ($DEBUG)) { - &logthis("Timeout on receive in londtransaction"); + if ($@ =~ /timeout/) { + &logthis("lonc - suiciding on send Timeout"); + die("lonc - suiciding on send Timeout"); } # # Restore the initial sigmask set.