mirror of
https://github.com/ShaYmez/ezservermonitor-web.git
synced 2024-11-15 21:01:46 -05: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');
|
||||
|
||||
$startTime = time();
|
||||
|
||||
$header = fread($handle, 1);
|
||||
|
||||
$endTime = time();
|
||||
|
||||
$timeDiff = $endTime - $startTime;
|
||||
|
||||
fclose($handle);
|
||||
|
||||
if ($timeDiff >= $timeout)
|
||||
return true;
|
||||
else
|
||||
if ($write === 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;
|
||||
|
Loading…
Reference in New Issue
Block a user