[LON-CAPA-cvs] cvs: newloncapa / loncnew

foxr lon-capa-cvs@mail.lon-capa.org
Wed, 09 Apr 2003 01:09:18 -0000


foxr		Tue Apr  8 21:09:18 2003 EDT

  Modified files:              
    /newloncapa	loncnew 
  Log:
  Use loncapa hostname, rather than dns name to open the server socket, taking
  advantage of changes to LondConnection.pm
  
  
Index: newloncapa/loncnew
diff -u newloncapa/loncnew:1.5 newloncapa/loncnew:1.6
--- newloncapa/loncnew:1.5	Wed Apr  2 21:40:22 2003
+++ newloncapa/loncnew	Tue Apr  8 21:09:18 2003
@@ -37,7 +37,7 @@
 my $IdleConnections = Stack->new();
 my %ActiveConnections;		# Connections to the remote lond.
 my %ActiveTransactions;		# Transactions in flight.
-my %ActiveClients;		# Set of local clients (by Socket).
+my %ActiveClients;		# Serial numbers of active clients by socket.
 
 
 my $WorkQueue       = Queue->new(); # Queue of pending transactions.
@@ -90,8 +90,12 @@
 =cut
 
 sub Tick {
+    my $client;
     Debug(4, "Tick");
     Debug(9, "    Current connection count: ".$ConnectionCount);
+    foreach $client (keys %ActiveClients) {
+	Debug(9, "    Have client:  with id: ".$ActiveClients{$client});
+    }
 }
 
 =pod
@@ -184,9 +188,8 @@
 	    #
 	    #  Set up to read next request from socket:
 	    
-	    my @info      = @ActiveClients{$Socket};
 	    my $descr     = sprintf("Connection to lonc client %d",
-				    $info[1]);
+				    $ActiveClients{$Socket});
 	    Event->io(cb    => \&ClientRequest,
 		      poll  => 'r',
 		      desc  => $descr,
@@ -237,8 +240,7 @@
     my $data   = $Socket->GetReply(); # Data to send.
 
     &Debug(8," Reply was: ".$data);
-    my @ClientInfo     = @ActiveClients{$Client};
-    my $Serial         = $ClientInfo[1];
+    my $Serial         = $ActiveClients{$Client};
     my $desc           = sprintf("Connection to lonc client %d",
 				 $Serial);
     Event->io(fd       => $Client,
@@ -637,7 +639,7 @@
 	Debug(2,"Socket closed");
 	close($socket);
 	$watcher->cancel();
-	delete(@ActiveClients{$socket});
+	delete($ActiveClients{$socket});
     }
     Debug(8,"Data: ".$data." this read: ".$thisread);
     $data = $data.$thisread;	# Append new data.
@@ -677,7 +679,7 @@
 	      desc    => $description,
 	      data    => "",
 	      fd      => $connection);
-    @ActiveClients{$connection} = ($Connection, $ClientConnection);
+    $ActiveClients{$connection} = $ClientConnection;
     $ClientConnection++;
 }
 =pod GetLoncSocketPath
@@ -693,7 +695,7 @@
    Returns the host whose lond we talk with.
 =cut
 sub GetServerHost {		# Stub - get this from config.
-    return "lonkashy.nscl.msu.edu";
+    return "nscll1";
 }
 =pod GetServerPort
    Returns the lond port number.