sub Is_Host_Alive { my ($host) = @_; my $tmp_syn=Net::Ping->new("syn"); $tmp_syn->ping($host); if(!$tmp_syn->ack){ # print "$host unreachable \n"; $tmp_syn->close; return 0; } $tmp_syn->close; return 1; }
sometimes the running result is correct,but sometimes is wrong.
In reply to Net::ping is very unstable by hxbsy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |