PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Networking » Net_Socket » Bug #1667

read() doesn't return if less than the maximum size is available

Details

Submitted2004-06-17 13:28 UTC
Fromjellybob at php dot net
StatusBogus
PackageNet_Socket
PHP Version5.0.0RC3 (Release Candidate 3)
OSWindows XP
Roadmaps(Not assigned)

Comments

[2004-06-17 13:28 UTC] jellybob at php dot net

Description:
------------
When attempting to use the read method with a specific size the method doesn't return unless at least that size is available, while in the documentation it is listed as being the *maximum* ammount of data to return, which appears to say that if less than that ammount is available, that will be returned instead.

Reproduce code:
---------------
[client]
$socket->send('echo');
$socket->receive(4096);
[server]
Sends back the send data (echo), which is less than 4096.

Expected result:
----------------
The 4 bytes of data available is returned.

Actual result:
--------------
No data is returned, and the socket blocks.