version 1.17, 2003/08/03 00:44:31
|
version 1.21, 2003/08/26 09:19:51
|
Line 45
|
Line 45
|
|
|
# Change log: |
# Change log: |
# $Log$ |
# $Log$ |
|
# Revision 1.21 2003/08/26 09:19:51 foxr |
|
# How embarrassing... put in the SocketTimeout function in loncnew and forgot |
|
# to actually hook it into the LondTransaction. Added this to MakeLondConnection |
|
# where it belongs... hopefully transactions (not just connection attempts) will |
|
# timeout more speedily than the socket errors will catch it. |
|
# |
|
# Revision 1.20 2003/08/25 18:48:11 albertel |
|
# - fixing a forgotten ; |
|
# |
|
# Revision 1.19 2003/08/19 09:31:46 foxr |
|
# Get socket directory from configuration rather than the old hard coded test |
|
# way that I forgot to un-hard code. |
|
# |
|
# Revision 1.18 2003/08/06 09:52:29 foxr |
|
# Also needed to remember to fail in-flight transactions if their sends fail. |
|
# |
# Revision 1.17 2003/08/03 00:44:31 foxr |
# Revision 1.17 2003/08/03 00:44:31 foxr |
# 1. Correct handling of connection failure: Assume it means the host is |
# 1. Correct handling of connection failure: Assume it means the host is |
# unreachable and fail all of the queued transactions. Note that the |
# unreachable and fail all of the queued transactions. Note that the |
Line 143 my $IdleTimeout= 3600; # Wait an hour b
|
Line 159 my $IdleTimeout= 3600; # Wait an hour b
|
# The variables below are only used by the child processes. |
# The variables below are only used by the child processes. |
# |
# |
my $RemoteHost; # Name of host child is talking to. |
my $RemoteHost; # Name of host child is talking to. |
my $UnixSocketDir= "/home/httpd/sockets"; |
my $UnixSocketDir= $perlvar{'lonSockDir'}; |
my $IdleConnections = Stack->new(); # Set of idle connections |
my $IdleConnections = Stack->new(); # Set of idle connections |
my %ActiveConnections; # Connections to the remote lond. |
my %ActiveConnections; # Connections to the remote lond. |
my %ActiveTransactions; # LondTransactions in flight. |
my %ActiveTransactions; # LondTransactions in flight. |
Line 928 sub LondWritable {
|
Line 944 sub LondWritable {
|
# We'll treat this as if the socket got disconnected: |
# We'll treat this as if the socket got disconnected: |
Log("WARNING", "Connection to ".$RemoteHost. |
Log("WARNING", "Connection to ".$RemoteHost. |
" has been disconnected"); |
" has been disconnected"); |
|
FailTransaction($ActiveTransactions{$Socket}); |
$Watcher->cancel(); |
$Watcher->cancel(); |
KillSocket($Socket); |
KillSocket($Socket); |
return; |
return; |
Line 1083 sub MakeLondConnection {
|
Line 1100 sub MakeLondConnection {
|
&Debug(9,"MakeLondConnection got socket: ".$Socket); |
&Debug(9,"MakeLondConnection got socket: ".$Socket); |
} |
} |
|
|
|
$Connection->SetTimeoutCallback(\&SocketTimeout); |
|
|
$event = Event->io(fd => $Socket, |
$event = Event->io(fd => $Socket, |
poll => 'w', |
poll => 'w', |
cb => \&LondWritable, |
cb => \&LondWritable, |