php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6301 fread with UDP filepointer
Submitted: 2000-08-22 14:21 UTC Modified: 2000-09-21 10:46 UTC
From: Mr dot Chaos at area99 dot dk Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.0.1pl2 OS: win98
Private report: No CVE-ID: None
 [2000-08-22 14:21 UTC] Mr dot Chaos at area99 dot dk
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 ???.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-23 06:06 UTC] stas@php.net
So it doesn't crash, just stops?
Did you try non-blocking read (good idea with UDP anyway)?

 [2000-08-23 06:06 UTC] stas@php.net
So it doesn't crash, just stops?
Did you try non-blocking read (good idea with UDP anyway)?

 [2000-09-21 10:46 UTC] sniper@php.net
No feedback.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 03:01:30 2025 UTC