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

foxr lon-capa-cvs@mail.lon-capa.org
Wed, 22 Sep 2004 10:34:44 -0000


foxr		Wed Sep 22 06:34:44 2004 EDT

  Modified files:              
    /loncom	loncnew 
  Log:
  Continue adding latent support for child exit when connection count 
  trimmed to zero: Allow default host for GetLoncSocketPath and 
  SetupLoncListener to be optionally parameterized with a loncapa
  hostname.  The actual server processes will typically not parameterize
  these, but the parent/master will.
  
  
  
Index: loncom/loncnew
diff -u loncom/loncnew:1.57 loncom/loncnew:1.58
--- loncom/loncnew:1.57	Wed Sep 22 06:22:50 2004
+++ loncom/loncnew	Wed Sep 22 06:34:44 2004
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # lonc maintains the connections to remote computers
 #
-# $Id: loncnew,v 1.57 2004/09/22 10:22:50 foxr Exp $
+# $Id: loncnew,v 1.58 2004/09/22 10:34:44 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1395,10 +1395,20 @@
 Returns the name of the UNIX socket on which to listen for client
 connections.
 
+=head2 Parameters:
+
+    host (optional)  - Name of the host socket to return.. defaults to
+                       the return from GetServerHost().
+
 =cut
 
 sub GetLoncSocketPath {
-    return $UnixSocketDir."/".GetServerHost();
+
+    my $host = GetServerHost();	# Default host.
+    if (@_) {
+	($host)  = @_;		# Override if supplied.
+    }
+    return $UnixSocketDir."/".$host;
 }
 
 =pod
@@ -1435,12 +1445,21 @@
 (creating a communcations channel), that int turn will establish
 another event handler to subess requests.
 
+=head2  Parameters:
+
+   host (optional)   Name of the host to set up a unix socket to.
+
 =cut
 
 sub SetupLoncListener {
 
+    my $host       = GetServerHost(); # Default host.
+    if (@_) {
+	($host)    = @_		# Override host with parameter.
+    }
+
     my $socket;
-    my $SocketName = GetLoncSocketPath();
+    my $SocketName = GetLoncSocketPath($host);
     unlink($SocketName);
     unless ($socket =IO::Socket::UNIX->new(Local  => $SocketName,
 					    Listen => 250,