$updated_sockets = $this->sockets;
socket_select($updated_sockets, $write = NULL, $exceptions = NULL, NULL);
foreach ($updated_sockets as $socket) {
if ($socket == $this->socket) {
// A new connection
$resource = socket_accept($socket);
if ($resource !== false) {
$client = new $this->client_class($resource);
$this->clients[$resource] = $client;
$this->sockets[] = $resource;
} else {
// socket error
}
}
}
}
