Req #30926 [Opn->Bgs]: change the return value of socket_select() !
| From: | jani@php.net | Date: | Thu, 18 Nov 2010 22:50:52 +0000 |
| Subject: | Req #30926 [Opn->Bgs]: change the return value of socket_select() ! | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-156186@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=30926&edit=1
ID: 30926
Updated by: jani@php.net
Reported by: igor at gameplasma dot com
Summary: change the return value of socket_select() !
-Status: Open
+Status: Bogus
Type: Feature/Change Request
-Package: Feature/Change Request
+Package: Sockets related
Operating System: Linux
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
From http://www.php.net/socket_select
"No socket resource must be added to any set if you do not intend to
check its result after the socket_select() call, and respond
appropriately. After socket_select() returns, all socket resources in
all arrays must be checked. Any socket resource that is available for
writing must be written to, and any socket resource available for
reading must be read from."
Previous Comments:
------------------------------------------------------------------------
[2004-11-29 02:59:47] igor at gameplasma dot com
Description:
------------
Hi, I've noticed that when using socket_select() it will return an
integer greater than 0 when something has happened to one of the sockets
we are watching.
Then, if we are watching, say 100 sockets, we must go through each one
of them until we find the one we can now access.
Instead, how about returning an array with 2 elements?
$array[0] will be a pointer to the socket that was changed
$array[1] will be "r" or "w" or "e" to indicate whether it's now
avaible
for read, write, or there is an error :).
Thanks!
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=30926&edit=1