ho fatto un piccolo script che dato un host si connette e calcola il tempo impiegato per l'operazione
Codice PHP:
$timeout=6;
$tempo1 = microtime_float();
$connHandle = @fsockopen($host,$port,$errnum,$errstr,$timeout);
if(!is_resource($connHandle)){
$stato = "off";
}
else{
$stato = "on";
$tempo2 = microtime_float();
$tempoT = $tempo2 - $tempo1;
$ping = round($tempoT,3) * 1000 . "ms";
}
@fclose($connHandle);
ora, quanto è attendibile la cosa? se il server è carico dovrebbe più tempo giusto?
altri metodi?