Thursday, 19 September 2013

PHP - sleep function is IIS

PHP - sleep function is IIS

I write the php code in iis to serve file for download with speed limit,
so i need to use sleep function for speed limit.
here a few line of my code
while(!feof($file))
{
echo fread($file, 1024*10);
ob_flush();
flush();
sleep(1);
if (connection_status()!=0)
{
@fclose($file);
exit;
}
}
But the browser say 'Waiting For mysite'.
if i remove sleep(1) every thing is right.
I also test it in apache and everything is right too.
so I have problem in IIS with sleep function
sry for bad english

No comments:

Post a Comment