[LON-CAPA-cvs] cvs: loncom / LondConnection.pm loncnew
foxr
foxr@source.lon-capa.org
Mon, 24 Jan 2011 11:02:32 -0000
foxr Mon Jan 24 11:02:32 2011 EDT
Modified files:
/loncom loncnew LondConnection.pm
Log:
Add a 'ClientData' member to LondConnection and have loncnew use it to
properly keep track of which connection is which.
(Bug 6377 comment 43).
Index: loncom/loncnew
diff -u loncom/loncnew:1.94 loncom/loncnew:1.95
--- loncom/loncnew:1.94 Thu Jan 20 11:19:37 2011
+++ loncom/loncnew Mon Jan 24 11:02:32 2011
@@ -2,7 +2,7 @@
# The LearningOnline Network with CAPA
# lonc maintains the connections to remote computers
#
-# $Id: loncnew,v 1.94 2011/01/20 11:19:37 foxr Exp $
+# $Id: loncnew,v 1.95 2011/01/24 11:02:32 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -946,7 +946,8 @@
CompleteTransaction($Socket,
$ActiveTransactions{$Socket});
} else {
- Log("SUCCESS", "Connection ".$ConnectionCount." to "
+ my $count = $Socket->GetClientData();
+ Log("SUCCESS", "Connection ".$count." to "
.$RemoteHost." now ready for action");
}
ServerToIdle($Socket); # Next work unit or idle.
@@ -1240,6 +1241,7 @@
&SetupTimer; # Need to handle timeouts with connections...
}
$ConnectionCount++;
+ $Connection->SetClientData($ConnectionCount);
Debug(4, "Connection count = ".$ConnectionCount);
if($ConnectionCount == 1) { # First Connection:
QueueDelayed;
@@ -1351,8 +1353,7 @@
}
}
-#-------------------------- Lonc UNIX socket handling ---------------------
-
+#-------------------------- Lonc UNIX socket handling -------------------
=pod
=head2 ClientRequest
Index: loncom/LondConnection.pm
diff -u loncom/LondConnection.pm:1.51 loncom/LondConnection.pm:1.52
--- loncom/LondConnection.pm:1.51 Thu Jan 20 11:16:20 2011
+++ loncom/LondConnection.pm Mon Jan 24 11:02:32 2011
@@ -1,7 +1,7 @@
# This module defines and implements a class that represents
# a connection to a lond daemon.
#
-# $Id: LondConnection.pm,v 1.51 2011/01/20 11:16:20 foxr Exp $
+# $Id: LondConnection.pm,v 1.52 2011/01/24 11:02:32 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -189,7 +189,8 @@
LocalKeyFile => "",
CipherKey => "",
LondVersion => "Unknown",
- Cipher => undef};
+ Cipher => undef,
+ ClientData => undef};
bless($self, $class);
unless ($self->{Socket} = IO::Socket::INET->new(PeerHost => $self->{Host},
PeerPort => $self->{Port},
@@ -1141,6 +1142,21 @@
return $version;
}
+#
+# Manipulate the client data field
+#
+sub SetClientData {
+ my ($self, $newData) = @_;
+ $self->{ClientData} = $newData;
+}
+#
+# Get the current client data field.
+#
+sub GetClientData {
+ my $self = shift;
+ return $self->{ClientData};
+}
+
1;
=pod