perlmonkdr has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks!!
I would like implement a timeout on lwp using the https protocol, i know that's have a bug and not work at least on win, so i think in that:
#!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new( GET => "https://www.amazon.com" ); my $page = ""; eval {local $SIG{ALRM}=sub{die("timeout\n");}; alarm 40; my $res = $ua->request($req); if ($res->is_success) { $page = $res->content; } alarm 0; };
But not works too, What's the correct workaround to solve the timeout problem on https protocol?
Thk U
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Workaround of Timeout on https
by starbolin (Hermit) on May 14, 2008 at 16:13 UTC | |
by perlmonkdr (Beadle) on May 15, 2008 at 13:54 UTC | |
by starbolin (Hermit) on May 15, 2008 at 16:45 UTC |