--- loncom/LondConnection.pm 2003/12/08 20:32:17 1.19 +++ 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.19 2003/12/08 20:32:17 albertel 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; @@ -562,9 +562,15 @@ Shuts down the socket. sub Shutdown { my $self = shift; my $socket = $self->GetSocket(); - $socket->send("exit\n", 0); # Ask lond to exit too. Non blocking so - # there's no cost for failure. - $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 @@ -786,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=) @@ -799,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.