a few disconnect ehancements
authorminima <minima>
Thu, 29 Mar 2001 22:51:11 +0000 (22:51 +0000)
committerminima <minima>
Thu, 29 Mar 2001 22:51:11 +0000 (22:51 +0000)
perl/AGWMsg.pm

index 6afcbcba18416aac52cee63e5d10b605edd4c09b..7582e2c723be8d45e0e3b0f23293e3d6f72174a3 100644 (file)
@@ -51,7 +51,7 @@ sub init
        
        finish();
        dbg('err', "AGW initialising and connecting to $addr/$port ...");
-       $sock = IO::Socket::INET->new(PeerAddr => $addr, PeerPort => $port, Proto=>'tcp', Timeout => 30);
+       $sock = IO::Socket::INET->new(PeerAddr => $addr, PeerPort => $port, Proto=>'tcp', Timeout=>15);
        unless ($sock) {
                dbg('err', "Cannot connect to AGW Engine at $addr/$port $!");
                return;
@@ -206,7 +206,7 @@ sub _error
        Msg::set_event_handler($sock, read=>undef, write=>undef, error=>undef);
        $sock = undef;
        for (%circuit) {
-               next unless $_->isa('AGWMsg');
+               &{$_->{eproc}}() if $_->{eproc};
                $_->disconnect;
        }
 }