--- loncom/Attic/lonc 2003/02/03 18:03:52 1.45 +++ loncom/Attic/lonc 2003/02/07 22:22:01 1.46 @@ -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.46 2003/02/07 22:22:01 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);