first cut at outgoing ax25 / external connects
[spider.git] / perl / Msg.pm
index f3dec8b1610b5743e5596b7b406bd9d9ed760304..eb6892a8f1f3568f41bbda4dd3316fe78f63ee98 100644 (file)
@@ -167,8 +167,6 @@ sub disconnect {
        $call ||= 'unallocated';
        dbg('connll', "Connection $call disconnected");
        
-    set_event_handler ($sock, read => undef, write => undef, error => undef);
-
        unless ($^O =~ /^MS/i) {
                kill 'TERM', $conn->{pid} if exists $conn->{pid};
        }
@@ -181,6 +179,7 @@ sub disconnect {
        }
 
        return unless defined($sock);
+    set_event_handler ($sock, read => undef, write => undef, error => undef);
     shutdown($sock, 3);
        close($sock);
 }