#24862 [Opn->Fbk]: feof() never reports false
| From: | iliaa@php.net | Date: | Wed, 30 Jul 2003 00:22:28 +0000 |
| Subject: | #24862 [Opn->Fbk]: feof() never reports false | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-45025@lists.php.net to get a copy of this message | ||
ID: 24862
Updated by: iliaa@php.net
Reported By: dasak36 at comcast dot net
-Status: Open
+Status: Feedback
Bug Type: Sockets related
Operating System: Windows XP pro
PHP Version: 4.3.2
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
The stream_set_blocking($fp, false); is not necessary.
Previous Comments:
------------------------------------------------------------------------
[2003-07-29 18:13:27] dasak36 at comcast dot net
Description:
------------
I read a thread on this here at bugs.php.net. It is the only one I can
find of its kind. The problem I am having is this. Whenever I am
reading the information from a socket like in the below code(which i
got from the other post here):
$fp = fsockopen("localhost", 25);
stream_set_blocking($fp, false);
fwrite($fp, "QUIT\r\n");
while(!feof($fp)) {
$data = fgets($fp);
var_dump($data);
}
echo "\nAll done\n";
The page hangs because feof($fp) never returns true.
I've been messing with this for a while but I cannot get this to work.
PHP version 4.3.2.
Thanks,
Tommy
PS: after I submitted this the site gave me other posts to check.
Some have the similar problem, but as before none were really answered.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24862&edit=1