Timeout on fread
Posted: Fri Dec 17, 2004 1:24 pm
Correct me if I am wrong, shouldn't the following code time out after 3 seconds, so if the file I am reading from doesn't exist it will give up instead of freezeing up
A site I was getting an xml data feed from went down and I noticed my code wasn't working, was my server just lagging or is there an error in my code.
Thank you in advance
Code: Select all
<?php
$xml = '';
$time=time();
$File=fopen($uFile, "rb");
while (!feof($File) AND $time+3>$time) {
$xml .= fread(uFile, 8192);
}
fclose($File);
?>Thank you in advance