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
 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 21:01:28 2024 UTC