#45329 [Opn->Bgs]: Bug with opening udp socket on localhost
| From: | johannes@php.net | Date: | Sun, 22 Jun 2008 21:37:29 +0000 |
| Subject: | #45329 [Opn->Bgs]: Bug with opening udp socket on localhost | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-125943@lists.php.net to get a copy of this message | ||
ID: 45329
Updated by: johannes@php.net
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