feof , http and hanging...
Posted: Tue Aug 04, 2009 2:27 am
hello,
I tried to connect to a http server (google. for example) using sockets. i have opened socked, got a full reply from the server and... my code is dead-looping. It does not recognize EOF i think. I have read that there are some issues with EOF, I have tried different thinks and nothing... any ideas?
for example this is dead-looping:
I tried to connect to a http server (google. for example) using sockets. i have opened socked, got a full reply from the server and... my code is dead-looping. It does not recognize EOF i think. I have read that there are some issues with EOF, I have tried different thinks and nothing... any ideas?
for example this is dead-looping:
Code: Select all
$cur = fgets($fp,1024);
while(!feof($fp)){
echo $cur;
$cur = fgets($fp,1024);
}