ID: 45329 Updated by: [EMAIL PROTECTED] Reported By: mk75 at sky dot ru -Status: Open +Status: Bogus Bug Type: Sockets related Operating System: Windows XP SP2 PHP Version: 5.2.6 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php UDP is a connection less protocol Previous Comments: ------------------------------------------------------------------------ [2008-06-22 10:14:45] mk75 at sky dot ru Changed type of bug ------------------------------------------------------------------------ [2008-06-22 07:27:25] mk75 at sky dot ru Description: ------------ Hello. I opening udp socket on my ip adress on closed port and fsock open don't return error, but when i trying make fread after fwrite i've got error reading socket. Reproduce code: --------------- function STAT_PACKET() { $packet = pack("H*","FFFFFFFF"); $packet .= "TSource Engine Query"; $packet .= pack("H*","00"); return $packet; } if (!$socket=fsockopen("udp://127.0.0.1",324,$errno,$errstr,2)) { die("Error opening socket: $errstr<br>Code of error: $errno"); } fwrite ($socket,STAT_PACKET()); if (!$buff=fread ($socket,1000)){echo "Error reading socket";return false;} ; $buffer = trim(substr($buff, 4)); if (!trim($buffer)) { echo "error";return false; } fclose($socket); Expected result: ---------------- Code print Error reading socket and return false then exit. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45329&edit=1
