Re: Is it a bug ?
| From: | Fourat Zouari | Date: | Sun, 14 May 2006 14:24:30 +0000 |
| Subject: | Re: Is it a bug ? | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-236150@lists.php.net to get a copy of this message | ||
cajbecu, am talking about non-blocking sockets, that's a simple blocking
socket
On 5/14/06, cajbecu <cajbecu@gmail.com> wrote:
$var = file ("http://www.some.server.net:someport"); then $var=explode ... bla bla.. that never crash. cheers, cajbecu On 5/14/06, Fourat Zouari <fourat@gmail.com> wrote: On 5/14/06, Fourat Zouari <fourat@gmail.com> wrote:ok this is returning the retrived data from open sockets : http://pastebin.com/716768 this is returning an empty string : http://pastebin.com/716767it'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 ? On 5/14/06, chris smith <dmagick@gmail.com> wrote:On 5/14/06, Fourat Zouari <fourat@gmail.com> wrote:Code 1 : ------------------------- var_dump(stream_get_contents($rr)); ------------------------- Output 1 ------------------------- string(185) "HTTP/1.1 202 Accepted Server: Apache2 Content-Length: 24 Connection: close Content-type: text/html Pragma: no-cache Cache-Control: no-cache 0: Accepted for delivery" ------------------------- Code 2 : ------------------------- $x = stream_get_contents($rr); var_dump($x); ------------------------- Output 2 ------------------------- string(0) "" ------------------------- Am i wrong ?Without seeing all of the code, we can't tell anything from that. Post it in http://pastebin.com and send us a url. -- Postgresql & php tutorials http://www.designmagick.com/