From: Xuefer at 21cn dot com
Operating system: -
PHP version: 4.3.4RC1
PHP Bug Type: Feature/Change Request
Bug description: faster client lookup after socket_select

it's slow that phpscript itself have to loop through $fds and use in_array
to know which client is sending data

$allfds[0] = socket_create(...);
$clients[0] = new MyClient($allfds[0]);

$count = socket_select($fds);
for ($i = 0; $i < FDSIZE; $i ++) {
if (in_array($fds, $allfds[$i])) {
larger FDSIZE make script slower

i'd suggest $fd resource store more information: ID
int socket_set_id(source $sock)
int socket_get_id(source $sock)

$allfds[0] = socket_create(...);
$clients[0] = new MyClient($allfds[0]);
socket_set_id($allfds[0], 0);
$allfds[1] = socket_create(...);
$clients[1] = new MyClient($allfds[1]);
socket_set_id($allfds[1], 1);

$count = socket_select($fds);
for ($i = 0; $i < $count; $i ++) {
$id = socket_get_id($fds[$i]);
speed is not depend on FDSIZE

Edit bug report at [url][/url]
Try a CVS snapshot (php4): [url][/url]
Try a CVS snapshot (php5): [url][/url]
Fixed in CVS: [url][/url]
Fixed in release: [url][/url]
Need backtrace: [url][/url]
Try newer version: [url][/url]
Not developer issue: [url][/url]
Expected behavior: [url][/url]
Not enough info: [url][/url]
Submitted twice: [url][/url]
register_globals: [url][/url]
PHP 3 support discontinued: [url][/url]
Daylight Savings: [url][/url]
IIS Stability: [url][/url]
Install GNU Sed: [url][/url]
Floating point limitations: [url][/url]