I used 'classic' code with fsockopen()
to 'ping' necessary hosts. I had no problem with it at all. But I can't reach one host, always receiving error 110 : Connection timed out
.
But other instruments, like paping, or http://www.yougetsignal.com/tools/open-ports/ confirm that the host is online.
$domain = 'XXX.XX.XXX.XXX';
$port = '40001';
$starttime = microtime(true);
$file = fsockopen($domain, $port, $errno, $errstr, 20);
$stoptime = microtime(true);
$status = 0;
if ($file === false) {
echo $errno." : ".$errstr."</br>";
}
if (!$file) {
$status = -1; // Site is down
echo 'camera ping failed'.'</br>';
}
else {
fclose($file);
$status = ($stoptime - $starttime) * 1000;
$status = floor($status);
}
Thanks for any advice or ideas.