|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35224 stream_select returning incorrect number
Submitted: 2005-11-15 10:19 UTC Modified: 2005-11-15 10:48 UTC
From: rh at alflex dot nl Assigned:
Status: Closed Package: Sockets related
PHP Version: 5.0.5 OS: Gentoo on Xeon64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
19 + 47 = ?
Subscribe to this entry?

 [2005-11-15 10:19 UTC] rh at alflex dot nl
stream_select() returns 0 while the first array provided does contain a changed socket (one waiting to be stream_socket_accpet()'ted)

same code does work with same php version on gentoo on a P2 text machine.
My solution is to use $count = count($read); afther the stream_select()

Reproduce code:
$socket = stream_socket_server("tcp://", $errno, $errstr);
$read[] = $socket;

$mod_fd = stream_select($read, $_w = NULL, $_e = NULL, 5);
echo $mod_fd;
$mod_fd = count($read);
echo $mod_fd;

Expected result:
twice 1 when there is a waiting socket

Actual result:
0 and 1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-15 10:21 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-11-15 10:38 UTC] rh at alflex dot nl
Problem is solved in that version indeed.
 [2005-11-15 10:48 UTC]
Fixed -> closed.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Aug 12 05:05:44 2022 UTC