Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Problems? Is your data what you think it is?
 
PerlMonks  

Re: LWP timeout

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

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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 14: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
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.