|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13572 fread doesn't read from udp sockets
Submitted: 2001-10-06 04:04 UTC Modified: 2001-11-21 13:19 UTC
From: trh at gmx dot li Assigned:
Status: Closed Package: Sockets related
PHP Version: 4.0.6 OS: Windows 2k/Linux
Private report: No CVE-ID: None
 [2001-10-06 04:04 UTC] trh at gmx dot li
socket's set to non-blocking, opened at port 9999 udp

  $res=fread($fp2, 100);
  echo "$res\n";

no answer from udp socket... a similar c program works

btw: in php4.0.7rc3 the problem isn't fixed


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-06 04:26 UTC]
In 4.0.7 a new socket has been introduced. Did you used it?

- markus
 [2001-10-06 04:31 UTC] trh at gmx dot li
i used fsockopen("udp://$host", $port ....)
socket_set_blocking($fp, FALSE)

 [2001-10-06 20:20 UTC]
Does the example UDP script on the manual page for fsockopen() work for you? It does for me so I doubt this is a bug..


 [2001-10-07 09:26 UTC] trh at gmx dot li
i tried now:
  $fp=fsockopen("udp://", $mudport, $errno,$errstr);

  socket_set_timeout($fp, 3);

   echo "con: ok<br>";
   fwrite($fp, "$query_string");
   echo fread($fp, 100);

result is, that php still does not receive an answer from the request (php4.0.7rc3 compiled as cgi for linux)

tcpdump proves, that there was an answer:
15:22:30.654252 > udp 39
15:22:30.661213 > udp 126

 [2001-10-31 19:34 UTC]
You didn't try the example script from the manual.
Please try it. And what 'similar c program' are you
referring to? Are the sources somewhere available to see?


 [2001-11-21 13:19 UTC]
No feedback. Closing.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Jul 01 11:05:45 2022 UTC