#35224 [Opn->Csd]: stream_select returning incorrect number

From: Date: Tue, 15 Nov 2005 09:48:58 +0000
Subject: #35224 [Opn->Csd]: stream_select returning incorrect number
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-88191@lists.php.net to get a copy of this message
ID: 35224 Updated by: tony2001@php.net Reported By: rh at alflex dot nl -Status: Open +Status: Closed Bug Type: Sockets related Operating System: Gentoo on Xeon64 PHP Version: 5.0.5 New Comment: Fixed -> closed. Previous Comments: ------------------------------------------------------------------------ [2005-11-15 10:38:27] rh at alflex dot nl Problem is solved in that version indeed. ------------------------------------------------------------------------ [2005-11-15 10:21:06] 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:19:43] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35224&edit=1

« previous php.bugs (#88191) next »