in reply to Enabling timeout method in LWP::UserAgent

Hi,

Try setting the timeout before making the request:
#!/usr/bin/perl use Crypt::SSLeay; use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->timeout(3); my $response = $ua->get('https://66.11.78.112'); #.... and so on
The above code is untested btw.
hope this helps,

Martin

Replies are listed 'Best First'.
Re^2: Enabling timeout method in LWP::UserAgent
by dReKurCe (Scribe) on Jul 27, 2005 at 22:30 UTC
    Marto: Thanks for the quick reply but this change does not produce a succesful early timeout.
      Strange,

      Im not getting the 3 minute timeout your still experiencing with the above code.

      Martin

        That 3 you passed to timeout() is 3 seconds, not 3 minutes. However, if you omit the parameter, the default value is 3 minutes (or 180 seconds).

      UPDATE:
      Grettings monks, the difficulty ecountered with this call to timeout appears to be related to https. Thanks all.