Can someone explain exactly what socket_select does and what purpose it serves?
I've read the info on it at php.net and looked at the examples/tutorials. Bascially I understand that it accepts an array of sockets, and it knows when something about them changes. But what I don't understand is what exactly it does when it detects a change.
Thanks very much,
-Chris
Help with socket_select
Moderator: General Moderators
-
kaoskorruption
- Forum Commoner
- Posts: 28
- Joined: Tue Jul 18, 2006 2:09 pm
-
kaoskorruption
- Forum Commoner
- Posts: 28
- Joined: Tue Jul 18, 2006 2:09 pm
Simple example:
Code: Select all
$read_sockets = array($socket1, $socket2);
socket_select($read_sockets, null, null, null);
// once you hit this line, you would have in $read_sockets only those socket that are ready to be read from.-
kaoskorruption
- Forum Commoner
- Posts: 28
- Joined: Tue Jul 18, 2006 2:09 pm