Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: LWP timeout

by Jouke (Curate)
on Apr 02, 2001 at 17:57 UTC ( [id://68999]=note: print w/replies, xml ) Need Help??


in reply to LWP timeout

Something like this should be possible:
$ua -> timeout(45); $SIG{'ALRM'} = sub { die ("Timeout after 45 seconds"); };
So you first set the timeout to 45 seconds and afterwards you connect the 'ALRM' signal to a subroutine that deals with what to do with it...

Jouke Visser, Perl 'Adept'

Replies are listed 'Best First'.
Re: Re: LWP timeout
by arhuman (Vicar) on Apr 02, 2001 at 18:17 UTC
    You must be warned of one potential pitfall :

    The timeout may seem to NOT work, if the host you're trying to connect is unreachable
    (you may wait long minutes whatever the number of seconds you used in your timeout() function...)
    See this post for more info.


    "Only Bad Coders Badly Code In Perl" (OBC2IP)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://68999]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2025-05-21 05:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.