php.net |  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rh at alflex dot nl
New email:
PHP Version: OS:

 

 [2005-11-15 10:19 UTC] rh at alflex dot nl
Description:
------------
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://0.0.0.0:4141", $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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-15 10:21 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-11-15 10:38 UTC] rh at alflex dot nl
Problem is solved in that version indeed.
 [2005-11-15 10:48 UTC] tony2001@php.net
Fixed -> closed.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Jul 03 18:03:33 2022 UTC