Scan Port : check the return of the fwrite #59

This commit is contained in:
ShevAbam 2018-04-03 10:01:07 +02:00
parent 1d3a790919
commit 050b1b615b
1 changed files with 20 additions and 13 deletions

View File

@ -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;