mirror of
https://github.com/ShaYmez/ezservermonitor-web.git
synced 2025-09-03 05:37:48 -04:00
Scan Port : check the return of the fwrite #59
This commit is contained in:
parent
1d3a790919
commit
050b1b615b
@ -189,20 +189,27 @@ class Misc
|
|||||||
|
|
||||||
$write = fwrite($handle, 'x00');
|
$write = fwrite($handle, 'x00');
|
||||||
|
|
||||||
$startTime = time();
|
if ($write === false)
|
||||||
|
{
|
||||||
$header = fread($handle, 1);
|
|
||||||
|
|
||||||
$endTime = time();
|
|
||||||
|
|
||||||
$timeDiff = $endTime - $startTime;
|
|
||||||
|
|
||||||
fclose($handle);
|
|
||||||
|
|
||||||
if ($timeDiff >= $timeout)
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$startTime = time();
|
||||||
|
|
||||||
|
$header = fread($handle, 1);
|
||||||
|
|
||||||
|
$endTime = time();
|
||||||
|
|
||||||
|
$timeDiff = $endTime - $startTime;
|
||||||
|
|
||||||
|
fclose($handle);
|
||||||
|
|
||||||
|
if ($timeDiff >= $timeout)
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user