note 52348 rejected from function.socket-select by betz
| From: | betz@php.net | Date: | Wed, 02 Nov 2005 04:48:21 +0000 |
| Subject: | note 52348 rejected from function.socket-select by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-97966@lists.php.net to get a copy of this message | ||
Note Submitter: drenintell
----
After many hours of testing, I can conclude that socket_select has limitations not mentioned here.
It could be a bug too.
First off, I have tested this on Windows XP and Windows 2000 with PHP 4.3.1.1 and PHP 5.0.4 (PHP CLI
version).
If you are running PHP4, socket_select will produce a warnning when you pass an array with 65 or
more sockets to block/monitor for changes. (That is 65 or more concurrent connections)
If you are running PHP5, the samething will happen if the array size is 257 or more sockets.
The warning you get is: "Warning: socket_select(): unable to select [0]: An operation was
attempted on something that is not a socket."
I am currently doing more testing. I will post my results here with some code that you can use to
see for yourself. For now you should know what the side effect is socket_select hanging until the
sockets monitored are 64 or less for PHP4 and 256 or less for PHP5. That of course happens when a
connection is dropped or a user disconnects. After that it SEEMS operations on the server continue
as usual. (Few tests were irrational, and I need to redo them to be sure operations continue as
normal)
Regards,
drenintell