I think you're just getting hung up on the variable name $clients. Ikegami's first code block is showing you the basic strategy of an event-driven program as applied to sockets. At the most conceptual level, it's something like:
while application doesn't need to quit: does task 1 need attention? Yes? Give it a little lovin' does task 2 want a hug? Yup--give it a bear hug . . . is task n unhappy? Uh huh: Give it a smile
The rules are that (1) asking a task whether it needs attention can't take a long time--otherwise you'll starve all your other tasks; and (2) none of the tasks you're performing can take a long time, either, for the same reason. So you'll use non-blocking I/O techniques to check your sockets because a normal read without checking will wait until that socket has something to say.
...roboticusIn reply to Re^5: Open&manage 2 sockets at one time
by roboticus
in thread Open&manage 2 sockets at one time
by motzi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |