Re[2]: [PHP] fread() behaviour

2008-11-28 Thread ANR Daemon
Greetings, Jochem Maas. In reply to Your message dated Thursday, November 20, 2008, 22:11:09, good stuff from Stut Craige ... I just wondered, Im pretty sure that the usleep(1000) is completely superfluous. fread() will read to the buffer length or EOF regardless of how slow the stream

Re: [PHP] fread() behaviour

2008-11-20 Thread Stut
On 20 Nov 2008, at 01:29, Rene Fournier wrote: I'm trying to understand something about fread(). I'm using fread() on an incoming socket stream that will send, for example, 26630 characters: while ( ($buf=fread($read[$i], 8192)) != '' ) { $sock_data .= $buf; usleep(1000);

Re: [PHP] fread() behaviour

2008-11-20 Thread Jochem Maas
Stut schreef: On 20 Nov 2008, at 01:29, Rene Fournier wrote: I'm trying to understand something about fread(). I'm using fread() on an incoming socket stream that will send, for example, 26630 characters: while ( ($buf=fread($read[$i], 8192)) != '' ) { $sock_data .= $buf;

[PHP] fread() behaviour

2008-11-19 Thread Rene Fournier
I'm trying to understand something about fread(). I'm using fread() on an incoming socket stream that will send, for example, 26630 characters: while ( ($buf=fread($read[$i], 8192)) != '' ) { $sock_data .= $buf; usleep(1000); echo .; } echo ,; As soon as the

Re: [PHP] fread() behaviour

2008-11-19 Thread Craige Leeder
Rene Fournier wrote: So my question is, why does fread wait if there is nothing more to read? Shouldn't it return immediately? (That's what I want.) And as for the delay, it's there so that if the incoming data is a little slow, it has time to catch up with fread. Thanks. ...Rene I do