[LON-CAPA-cvs] cvs: loncom / LondConnection.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 11 Dec 2003 23:16:06 -0000


albertel		Thu Dec 11 18:16:06 2003 EDT

  Modified files:              
    /loncom	LondConnection.pm 
  Log:
  - was throwing Event errors when it couldn't connect and marking things Dead
  
  
Index: loncom/LondConnection.pm
diff -u loncom/LondConnection.pm:1.19 loncom/LondConnection.pm:1.20
--- loncom/LondConnection.pm:1.19	Mon Dec  8 15:32:17 2003
+++ loncom/LondConnection.pm	Thu Dec 11 18:16:06 2003
@@ -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.20 2003/12/11 23:16:06 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -562,9 +562,15 @@
 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