Dear adam,

Thank you for your prompt reply.

Please see below.

Meir


> -----Original Message-----
> From: Adam "Sjøgren" [mailto:a...@koldfront.dk] 
> Sent: שבת 08 דצמבר 2012 21:30
> To: libwww@perl.org
> Subject: Re: LWP::UserAgent hangs on a hung http server
> 
> On Sat, 08 Dec 2012 21:15:19 +0200, Meir wrote:
> 
> > The problem is that when I am using ua, it hangs too, forever, and 
> > never times-out! A ^C is then required to abort it.
> 
> What did you set ->timeout() on your LWP::UserAgent object to?

In the actual application (not in the demo) it is set to 30 seconds

> 
> ,----[ perldoc LWP::UserAgent ]
> | NAME
> |        LWP::UserAgent - Web user agent class
> | 
> | SYNOPSIS
> |         require LWP::UserAgent;
> | 
> |         my $ua = LWP::UserAgent->new;
> |         $ua->timeout(10);
> |         $ua->env_proxy;
> | 
> |         my $response = $ua->get('http://search.cpan.org/');
> |
> | [...]
> |
> |        $ua->timeout
> |        $ua->timeout( $secs )
> |            Get/set the timeout value in seconds. The default timeout() value
> |            is 180 seconds, i.e. 3 minutes.
> |
> |            The requests is aborted if no activity on the connection to the
> |            server is observed for "timeout" seconds.  This means that the 
> time
> |            it takes for the complete transaction and the request() method to
> |            actually return might be longer.
> `----
> 
> How long did you wait? I just tried your script, where I added:

For as long as I waited. Twenty minutes even.

> 
>   $mech->timeout(10);
> 
> after the line where you create your WWW::Mechanize object, and I got a time 
> out after 10 seconds.
> 

OK, I added this to my demo too and it is still hanging...

> 
>   Best regards,
> 
>     Adam
> 
> -- 
>  "And so, after a three minute downpour, he became            Adam Sjøgren
>   ludicrously attired for the rest of the day."          a...@koldfront.dk
> 


Reply via email to