I found out that the problem is that the time out doesn't function as 
such for http.  If there is any negotiation, even if the page isn't 
returned, the time out doesn't start ticking.  I'm looking for a 
higher level time out that just works based on time from initial 
request until full page retrieval.




At 11:24 PM +0200 6/13/00, Gisle Aas wrote:
>Matthew Bachmann <[EMAIL PROTECTED]> writes:
>
> > I need to fetch a page into a string, and timout if it takes to long.
> >
> > Here is my attempt.
> >
> >
> > my $ua = LWP::UserAgent->new;
> > $ua->timeout(1);
> > my $url =  $urls{$server_num};
> > my $return = $ua->request(GET $url)->as_string;
> >
> >
> > This doesn't work.  It fetches the page fine, but it doesn't respect
> > the timeout.   If I try to fetch a page from a non-existant server,
> > it still tries for 30 seconds or so, then returns a string containing
> > an error message.  How do I get the code to use a timout, and what
> > will it return if the timout is triggered?
>
>If you are running perl <= 5.005_03 try to upgrade the IO modules
>first.  There are a known problem with the bundled stuff when it comes
>to connect timeouts.
>
>Regards,
>Gisle

Reply via email to