php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: trh at gmx dot li
New email:
PHP Version: OS:

 

 [2001-10-06 04:04 UTC] trh at gmx dot li
socket's set to non-blocking, opened at port 9999 udp

 $start=time();
 while((time()-$start)<2)
 {
  $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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-06 04:26 UTC] mfischer@php.net
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] sniper@php.net
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..

--Jani


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

  socket_set_timeout($fp, 3);

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

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 10.0.0.1.1062 > 10.0.0.2.4246: udp 39
15:22:30.661213 10.0.0.2.4246 > 10.0.0.1.4246: udp 126


 [2001-10-31 19:34 UTC] sniper@php.net
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?


--Jani

 [2001-11-21 13:19 UTC] sander@php.net
No feedback. Closing.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 02:01:28 2024 UTC