Bug #10304: Garbled Data/timeout with UDP-Socket
| From: | jorfen at topmail dot de | Date: | Thu, 12 Apr 2001 15:06:52 +0000 |
| Subject: | Bug #10304: Garbled Data/timeout with UDP-Socket | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-51497@lists.php.net to get a copy of this message | ||
From: jorfen@topmail.de
Operating system: Linux2.2.12
PHP version: 4.0.4pl1
PHP Bug Type: *Network Functions
Bug description: Garbled Data/timeout with UDP-Socket
1)
<?
function foo($ip,$port)
{
$fp = fsockopen("udp://".$ip,$port);
fwrite($fp,"ÿÿÿÿinfo\x00");
$a = fread($fp,5000);
fclose($fp);
}
?>
This code is for querying a HalfLife-Server (left out if
($fp) ...).
The script works till it tries to read from the socket.
PHP reads a part of the string the server should return
and hangs till the socket times out.
The same method in C, Perl etc works perfectly so I assume
there is a problems with PHP and UDP-Sockets.
2)
Trying to read multiple lines from a server connected to
with an UDP-Socket give garbled Data+Timeout.
Again C, Perl work perfectly.
(recent version from CVS do not work, too)
--
Edit Bug report at: http://bugs.php.net/?id=10304&edit=1