|
Posted by Chung Leong on 06/07/06 13:53
mydejamail@yahoo.co.uk wrote:
> This appears to imply that socket_select can only notify just 1 new
> socket, and that if more than 1 new connections have been made, the
> additional connections can only be detected on the next pass - is it
> so?
For practical purpose you're right. You can obviously select() multiple
sockets listening on different ports, but that's not the typical
scenario.
> Concerning the $sock value, the $read[0] = $sock at the top of the loop
> always makes $sock an element of the array, so I would expect
> in_array($sock, $read) to always return true. So I would take it that
> socket_select removes or modifies $read[0], or any instances of $read
> where $read[x] = $sock if there is no new connection, right?
That is correct. Hence the reference declaration for the arguments. PHP
typically doesn't do things this way. The semantic came from the socket
functions in C.
Navigation:
[Reply to this message]
|