chitownclone
Programmer
Anyone have an idea why some timeout is not working on some domain names that I Ping? There are certain DNs that are not active that take 20 seconds to timeout, even though I have it set to 1 or 2 seconds (I tried setting the timeout 2 different ways).
Is it the number of Pings it is sending before timeout or something else?
Thanks
Is it the number of Pings it is sending before timeout or something else?
Thanks
Code:
$p = Net::Ping->new("syn");
$p->{port_num} = getservbyname("http", "tcp");
$p->ping($url, 1);
($host,$rtt,$ip) = $p->ack;
$p->close();
$p = Net::Ping->new("syn", 2);
$p->{port_num} = getservbyname("http", "tcp");
$p->ping($url);
($host,$rtt,$ip) = $p->ack;
$p->close();