You are here: Re: Understanding socket_select routine « PHP Programming Language « IT news, forums, messages
Re: Understanding socket_select routine

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация