#35224 [NEW]: stream_select returning incorrect number

From: Date: Tue, 15 Nov 2005 09:19:44 +0000
Subject: #35224 [NEW]: stream_select returning incorrect number
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-88189@lists.php.net to get a copy of this message
From: rh at alflex dot nl Operating system: Gentoo on Xeon64 PHP version: 5.0.5 PHP Bug Type: Sockets related Bug description: stream_select returning incorrect number 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 -- Edit bug report at http://bugs.php.net/?id=35224&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35224&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=35224&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=35224&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=35224&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=35224&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=35224&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=35224&r=needscript Try newer version: http://bugs.php.net/fix.php?id=35224&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=35224&r=support Expected behavior: http://bugs.php.net/fix.php?id=35224&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=35224&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=35224&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=35224&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35224&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=35224&r=dst IIS Stability: http://bugs.php.net/fix.php?id=35224&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=35224&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=35224&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=35224&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=35224&r=mysqlcfg

« previous php.bugs (#88189) next »