version 1.35, 2003/12/12 09:57:28
|
version 1.38, 2004/01/05 09:29:36
|
Line 35
|
Line 35
|
# - Add ability to create/negotiate lond connections (done). |
# - Add ability to create/negotiate lond connections (done). |
# - Add general logic for dispatching requests and timeouts. (done). |
# - Add general logic for dispatching requests and timeouts. (done). |
# - Add support for the lonc/lond requests. (done). |
# - Add support for the lonc/lond requests. (done). |
# - Add logging/status monitoring. |
# - Add logging/status monitoring. (done) |
# - Add Signal handling - HUP restarts. USR1 status report. |
# - Add Signal handling - HUP restarts. USR1 status report. (done) |
# - Add Configuration file I/O (done). |
# - Add Configuration file I/O (done). |
# - Add management/status request interface. |
# - Add management/status request interface. (done) |
# - Add deferred request capability. (done) |
# - Add deferred request capability. (done) |
# - Detect transmission timeouts. |
# - Detect transmission timeouts. (done) |
# |
# |
|
|
use strict; |
use strict; |
Line 261 sub ShowStatus {
|
Line 261 sub ShowStatus {
|
=cut |
=cut |
sub SocketTimeout { |
sub SocketTimeout { |
my $Socket = shift; |
my $Socket = shift; |
|
Log("WARNING", "A socket timeout was detected"); |
|
Debug(0, " SocketTimeout called: "); |
|
$Socket->Dump(); |
KillSocket($Socket); # A transaction timeout also counts as |
KillSocket($Socket); # A transaction timeout also counts as |
# a connection failure: |
# a connection failure: |
$ConnectionRetriesLeft--; |
$ConnectionRetriesLeft--; |
Line 655 sub KillSocket {
|
Line 657 sub KillSocket {
|
} |
} |
if(exists($ActiveConnections{$Socket})) { |
if(exists($ActiveConnections{$Socket})) { |
delete($ActiveConnections{$Socket}); |
delete($ActiveConnections{$Socket}); |
|
$ConnectionCount--; |
|
if ($ConnectionCount < 0) { $ConnectionCount = 0; } |
} |
} |
$ConnectionCount--; |
|
|
|
# If the connection count has gone to zero and there is work in the |
# If the connection count has gone to zero and there is work in the |
# work queue, the work all gets failed with con_lost. |
# work queue, the work all gets failed with con_lost. |
# |
# |
Line 1342 sub ChildStatus {
|
Line 1344 sub ChildStatus {
|
my $fh = IO::File->new(">>$docdir/lon-status/loncstatus.txt"); |
my $fh = IO::File->new(">>$docdir/lon-status/loncstatus.txt"); |
print $fh $$."\t".$RemoteHost."\t".$Status."\t". |
print $fh $$."\t".$RemoteHost."\t".$Status."\t". |
$RecentLogEntry."\n"; |
$RecentLogEntry."\n"; |
|
# |
|
# Write out information about each of the connections: |
|
# |
|
print $fh "Active connection statuses: \n"; |
|
my $i = 1; |
|
print STDERR "================================= Socket Status Dump:\n"; |
|
foreach my $item (keys %ActiveConnections) { |
|
my $Socket = $ActiveConnections{$item}->data; |
|
my $state = $Socket->GetState(); |
|
print $fh "Connection $i State: $state\n"; |
|
print STDERR "---------------------- Connection $i \n"; |
|
$Socket->Dump(); |
|
$i++; |
|
} |
$ConnectionRetriesLeft = $ConnectionRetries; |
$ConnectionRetriesLeft = $ConnectionRetries; |
} |
} |
|
|