ID:               15639
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Feedback
 Bug Type:         *Network Functions
 Operating System: All
 PHP Version:      4.1.1
 New Comment:

My man page says that recv is identical to recvfrom with
a NULL from parameter, so I don't see how this can fix
it.
I still don't think this is technically possible over UDP.
If you can show me some real working C code where it works,
I will implement it.


Previous Comments:
------------------------------------------------------------------------

[2002-02-21 20:07:45] [EMAIL PROTECTED]

In C, recvfrom() takes a length argument, but behaves with UDP like
fread should : "Reading stops when length bytes have been read or EOF
is reached, whichever comes first."
Using recvfrom() with length set to 4096 will get the 20 bytes packets
without blocking anything.
The bug has prolly something to do with the use of recv() versus
recvfrom().

------------------------------------------------------------------------

[2002-02-20 22:42:53] [EMAIL PROTECTED]

I'll look into UDP sockets in PHP in more detail soon.
In the meantime, I'm not sure that what you are suggesting is possible,
since UDP is a connectionless protocol, how can we detect the end of a
packet/stream?
UDP is supposed to be used with known packet sizes.
If you can show me some C code where what you propose works, I'll
integrate it with the new PHP streams code.
--Wez.

------------------------------------------------------------------------

[2002-02-20 07:02:31] [EMAIL PROTECTED]

In fact it's worst than that, setting the socket non-blocking makes
fread not working on unix/win.

------------------------------------------------------------------------

[2002-02-20 06:41:24] [EMAIL PROTECTED]

It will kill Windows compatibility, fixing the functions is way better.

------------------------------------------------------------------------

[2002-02-20 06:35:09] [EMAIL PROTECTED]

What if you set the socket in non-blocking mode?
Look for socket_set_blocking in the manual.



------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/15639

-- 
Edit this bug report at http://bugs.php.net/?id=15639&edit=1

Reply via email to