Hello!

For my application I need to limit the speed that my application sends data, in 
my case a binary file.

I need to send the speed as a parameter, like:

sendfile.php?speed=20000

Would send the file at 20kb/s (forgetting about real byte counts for this 
example).

To send the file, I am doing:

    $fp=fopen($this->contentfile,"rb");
    while(!feof($fp)){
        print(fread($fp,1024*8));
        flush();
        ob_flush();
    }
    fclose($fp);

If after ob_flush I do a sleep(), I can limit the speed, but I would like to 
limit at the speed of the parameter.

Is there a way to do this?

Thanks,
Rangel

Reply via email to