develooper Front page | perl.libwww | Postings from December 2000

timeout problem in

Thread Next
Andrew Daviel
December 28, 2000 16:47
timeout problem in
Message ID:

I have been having some trouble with some web robot code
under RedHat 6.2 using libwww-perl-5.48 and

I found that if the destination address does not respond
that the connect in is not timing out

  use IO::Socket ;
  $sock = IO::Socket::INET->new(PeerAddr => '',
                       PeerPort => 'http(80)',
                       Proto     => 'tcp',
                       Timeout => 5) ;

I changed "undef" to "close" on line 203 and it seems to fix the
problem. I confess I don't really know what I'm doing ...

viz.       local($SIG{ALRM}) = $timeout ? sub { close $fh; }

Andrew Daviel, TRIUMF, Canada
Tel. +1 (604) 222-7376

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About