|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-06-12 00:52 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 21:00:02 2025 UTC |
<? 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)