Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: How move on to next ip if no connection got established?

by Henri Icarus (Beadle)
on Jun 04, 2001 at 22:59 UTC ( #85555=note: print w/replies, xml ) Need Help??


in reply to How move on to next ip if no connection got established?

As long as you are on a unix system that handles signals you can use this:
$seconds_allowed_to_do_task = 5; foreach (@list_of_things_to_do) { eval { local $SIG{ALRM} = sub { die "dead"}; alarm $seconds_allowed_to_do_task; &doTask($_); alarm 0; }; }
The eval loop get's killed by the "die" after the alarm goes off (if it does). So just put your IP address in the list, and make doTask be the function that does your http connection. -Henri

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2023-02-08 02:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (40 votes). Check out past polls.

    Notices?