--- loncom/LondConnection.pm 2003/11/04 11:22:48 1.17 +++ loncom/LondConnection.pm 2003/12/22 11:03:17 1.21 @@ -1,7 +1,7 @@ # This module defines and implements a class that represents # a connection to a lond daemon. # -# $Id: LondConnection.pm,v 1.17 2003/11/04 11:22:48 foxr Exp $ +# $Id: LondConnection.pm,v 1.21 2003/12/22 11:03:17 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -67,7 +67,7 @@ sub ReadConfig { my $perlvarref = read_conf('loncapa.conf'); %perlvar = %{$perlvarref}; my $hoststab = read_hosts( - "$perlvar{'lonTabDir'}/hosts.tab") || + "$perlvar{lonTabDir}/hosts.tab") || die "Can't read host table!!"; %hostshash = %{$hoststab}; $ConfigRead = 1; @@ -129,7 +129,7 @@ sub Dump { my $value; print "Dumping LondConnectionObject:\n"; while(($key, $value) = each %$self) { - print STDERR "$key -> $value\n"; + print "$key -> $value\n"; } print "-------------------------------\n"; } @@ -562,7 +562,15 @@ Shuts down the socket. sub Shutdown { my $self = shift; my $socket = $self->GetSocket(); - $socket->shutdown(2); + Debug(5,"socket is -$socket-"); + if ($socket) { + # Ask lond to exit too. Non blocking so + # there is no cost for failure. + eval { + $socket->send("exit\n", 0); + $socket->shutdown(2); + } + } } =pod @@ -784,6 +792,9 @@ sub read_conf my %perlvar; foreach my $filename (@conf_files,'loncapa_apache.conf') { + if($DebugLevel > 3) { + print("Going to read $confdir.$filename\n"); + } open(CONFIG,'<'.$confdir.$filename) or die("Can't read $confdir$filename"); while (my $configline=) @@ -797,9 +808,15 @@ sub read_conf } close(CONFIG); } + if($DebugLevel > 3) { + print "Dumping perlvar:\n"; + foreach my $var (keys %perlvar) { + print "$var = $perlvar{$var}\n"; + } + } my $perlvarref=\%perlvar; - return ($perlvarref); - } + return $perlvarref; +} #---------------------- Subroutine read_hosts: Read a LON-CAPA hosts.tab # formatted configuration file.