[LON-CAPA-cvs] cvs: loncom / lonc
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 07 Feb 2003 22:22:02 -0000
albertel Fri Feb 7 17:22:02 2003 EDT
Modified files:
/loncom lonc
Log:
- turning on KEEPALIVE
- adding more info to some status messages
Index: loncom/lonc
diff -u loncom/lonc:1.45 loncom/lonc:1.46
--- loncom/lonc:1.45 Mon Feb 3 13:03:52 2003
+++ loncom/lonc Fri Feb 7 17:22:01 2003
@@ -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 @@
# 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 @@
}
$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 @@
my $conserver=shift;
-&status("Opening TCP");
+&status("Opening TCP $conserver");
my $st=120+int(rand(240)); # Sleep before opening:
unless (
@@ -740,7 +742,7 @@
}
sleep 5;
-&status("Ponging");
+&status("Ponging $conserver");
print $remotesock "pong\n";
$answer=<$remotesock>;
chomp($answer);