#51152 [NEW]: socket_select

From: Date: Fri, 26 Feb 2010 07:35:45 +0000
Subject: #51152 [NEW]: socket_select
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-148070@lists.php.net to get a copy of this message
From:             9669105 at qq dot com
Operating system: windows xp
PHP version:      5.2.13
PHP Bug Type:     CGI related
Bug description:  socket_select

Description:
------------
I am not good at english . 

I pass an array with 257 sockets to monitor for changes, a warning :
unable to select [0]:An operation was attempted on something that is not a
socket.

Why?

Reproduce code:
---------------
$i = 0;
$sockets = array();
while (true) {
	$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
	if (socket_connect($socket, '192.168.1.101', 11001)) {
		socket_set_nonblock($socket);
		$sockets[] = $socket;
		$i = $i + 1;
	} else {
		break;
	}
}
echo $i;

Expected result:
----------------
$i=257 always.

How can pass an array more than 257 sockets ?


-- 
Edit bug report at http://bugs.php.net/?id=51152&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=51152&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=51152&r=trysnapshot53
Try a snapshot (PHP 6.0):            http://bugs.php.net/fix.php?id=51152&r=trysnapshot60
Fixed in SVN:                        http://bugs.php.net/fix.php?id=51152&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51152&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=51152&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=51152&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=51152&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=51152&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=51152&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=51152&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=51152&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=51152&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=51152&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=51152&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=51152&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=51152&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=51152&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=51152&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=51152&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=51152&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#148070) next »