X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FMsg.pm;h=839b5e453313e05db16f6f536ba26d3e4b1cdd31;hb=efefa52cf2a2f34cf57fb202b558880e167a28a4;hp=c730773aff702f9c1cbb4d79cad00932dd2f5036;hpb=2f1b948ea733e0ece1909a31987dc8f03044e851;p=spider.git diff --git a/perl/Msg.pm b/perl/Msg.pm index c730773a..839b5e45 100644 --- a/perl/Msg.pm +++ b/perl/Msg.pm @@ -135,7 +135,8 @@ sub connect { blocking($sock, 0); my $ip = gethostbyname($to_host); - my $r = $sock->connect($to_port, $ip); +# my $r = $sock->connect($to_port, $ip); + my $r = connect($sock, pack_sockaddr_in($to_port, $ip)); unless ($r) { return undef unless $! == EINPROGRESS; } @@ -167,8 +168,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 +180,7 @@ sub disconnect { } return unless defined($sock); + set_event_handler ($sock, read => undef, write => undef, error => undef); shutdown($sock, 3); close($sock); } @@ -425,7 +425,6 @@ sub event_loop { last unless ($rd_handles->count() || $wt_handles->count()); ($rset, $wset) = IO::Select->select($rd_handles, $wt_handles, $er_handles, $timeout); - $now = time; foreach $e (@$eset) { &{$er_callbacks{$e}}($e) if exists $er_callbacks{$e};