Re: Is it a bug ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, May 14, 2006 8:49 am, Fourat Zouari wrote:
> On 5/14/06, Fourat Zouari <fourat@xxxxxxxxx> wrote:
> it's not a bug :)
> i shoul wait for stream to be returned, i use :
> --------------------
>         while(($buff = stream_get_contents($socket[$i]))=="");
>         echo $buff;
> --------------------
> it takes sometime to receive stream from socket, is it the best way
> (dont
> think so) to wait for stream ?

Well, you could try to make the other end of the stream pump the data
out faster...

If you have $socket[$i] then you proably have multiple sockets open,
in which case methinks you want http://php.net/stream_select which
polls a bunch of streams in one go and gives you data from whatever
stream is ready.

In older PHP versions, where that function is not available, you can
hack this with something not unlike:
http://www.l-i-e.com/FeedMulti/

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux