php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10305 feof() does not work on udp-socket
Submitted: 2001-04-12 11:12 UTC Modified: 2001-06-12 00:52 UTC
From: jorfen at topmail dot de Assigned:
Status: Not a bug Package: Sockets related
PHP Version: 4.0.4pl1 OS: Linux2.2.12
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jorfen at topmail dot de
New email:
PHP Version: OS:

 

 [2001-04-12 11:12 UTC] jorfen at topmail dot de
<?
function foo($ip,$port)
{
$fp = fsockopen("udp://".$ip,$port);
socket_set_blocking($fp,FALSE);
fwrite($fp,"????info\x00");
while (!feof($fp))
	{
	$a = fread($fp,5000);
	if ($a) echo $a;
	}
fclose($fp);
}
?>

This code is for querying a HalfLife-Server (left out if 
($fp) ...).

It never leaves the while-loop because feof() never 
changes its state to TRUE.

The same method in C, Perl etc works perfectly so I assume 
there is a problems with PHP and UDP-Sockets.

(recent version from CVS do not work, too)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-12 00:52 UTC] sniper@php.net
submitted twice
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 21:01:30 2024 UTC