PHP 4.0 Bug #6301: fread with UDP filepointer
| From: | Mr dot Chaos at area99 dot dk | Date: | Tue, 22 Aug 2000 18:21:53 +0000 |
| Subject: | PHP 4.0 Bug #6301: fread with UDP filepointer | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-30237@lists.php.net to get a copy of this message | ||
From: Mr.Chaos@area99.dk
Operating system: win98
PHP version: 4.0.1pl2
PHP Bug Type: Reproduceable crash
Bug description: fread with UDP filepointer
I´m making a gameserver report script.
The problem is when i try to read the reply from the filepointer.
<?php
$charstoread=500;
$fp = pfsockopen("udp://localhost", 27960, &$errno, &$errstr, 10);
if(!$fp) {
echo "$errstr ($errno)<br>\n";
} else
fputs($fp,"\xff\xff\xff\xffgetstatus");
echo fread($fp, $charstoread);
fclose($fp);
?>
Since i don´t know how many char´s i have to read I use fread, because it should stop when it
reaches EOF, but it doesn´t stop.
PHP3 freezes, or enter an infinite loop, maybee because it´s unable to find EOF ???.