jfroebe has asked for the wisdom of the Perl Monks concerning the following question:
I've noticed that my gethostbyaddr is not being aborted after 2 seconds. I'm certain it is something obvious.. Anyone see the problem?
perplexed Jason
eval { local $SIG{ALRM} = sub { die "alarm clock restart" }; alarm 2; # schedule alarm for every 2 seconds eval { print "server1 $my_ipaddr\n"; $SybaseInterfaces::lookup_iptoname{$my_ipaddr} = getho +stbyaddr(inet_aton($my_ipaddr), AF_INET); print "server2\n"; }; alarm 0; print "server3\n"; }; print "server4\n"; alarm 0; die if $@ && $@ !~ /alarm clock restart/; #reraise }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SIGALRM and gethostbyaddr
by Abigail-II (Bishop) on Mar 17, 2004 at 23:59 UTC | |
by chip (Curate) on Mar 18, 2004 at 01:40 UTC | |
by jfroebe (Parson) on Mar 18, 2004 at 16:15 UTC | |
by jfroebe (Parson) on Mar 18, 2004 at 15:33 UTC |