|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-09-22 09:49 UTC] cmb@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: cmb
[2020-09-22 09:49 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 16:00:01 2025 UTC |
Description: ------------ When script creates resource with identifier greater than FD_SETSIZE and pass it as the only argument to stream_select, php warning is emitted and stream_select fails. Test script: --------------- <?php $nomatter = []; $sockets = []; for ($i = 0; $i <= 1024; $i++) { $sockets[] = stream_socket_client('tcp://php.net:80', $errno, $errstr, STREAM_CLIENT_ASYNC_CONNECT); } $s = stream_socket_client('tcp://php.net:80', $errno, $errstr, STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT); var_dump($s); $read = [$s]; $result = stream_select($read, $nomatter, $nomatter, 1); var_dump($result); Expected result: ---------------- resource(1030) of type (stream) int(1) Actual result: -------------- resource(1030) of type (stream) PHP Warning: stream_select(): You MUST recompile PHP with a larger value of FD_SETSIZE. It is set to 1024, but you have descriptors numbered at least as high as 1028. --enable-fd-setsize=2048 is recommended, but you may want to set it to equal the maximum number of open files supported by your system, in order to avoid seeing this error again at a later date. in /test.php on line 13 PHP Stack trace: PHP 1. {main}() /test.php:0 PHP 2. stream_select() /test.php:13 int(0)