timeouts not working
Andrew Daviel (advax@triumf.ca)
Thu, 28 Dec 2000 14:51:57 -0800 (PST)
I'm slowly converting some robot code from Perl4 to Perl5
(well, I thought I had done it but some things still aren't right)
I am currently trying to run on a RedHat 6.2 Linux system
which I believe comes with perl-5.00503-12 installed with RPM.
I have just installed libwww-perl-5.48 having previously been trying
5.42
Basically, the problem is that timeouts don't work.
I have some test code more-or-less like:
$url = new URI::URL $url ;
$ua = new LWP::UserAgent;
$ua->timeout(10);
$request = new HTTP::Request 'HEAD';
$request->url($url);
$response = $ua->request($request);
I have chased this down through as far as
IO::Socket::INET::configure(/usr/lib/perl5/5.00503/i386-linux/IO/Socket.pm:587):
587: $fh->connect($rport,$raddr) or
588: return _error($fh,"$!");
which appears to eventually timeout with a much longer timeout (many
minutes)
Also, it seems that any alarm handler I set up myself is also
ignored.
Is this some weird one-off thing on my system, or a problem
in perl-5.00503-12 ?
I confess I don't quite undertand Socket.pm as connect() seems
to be recursive and do nothing.
Andrew Daviel