/** * Create a client object with its associated socket * @param $socket */ public function connect($socket) { $this->console("Creating client..."); $id = uniqid(); //именованнй ид для удаления лишних одинаковых подключений $client = new \PushWebSocket\Client($id, $socket); //$client->name = 'name'.time();//установка имени клиента $this->clients[$id] = $client; $this->sockets[$id] = $socket; $this->console("Client #{$client->getId()} is successfully created!"); }
/** * Create a client object with its associated socket * @param $socket */ private function connect($socket) { $this->console("Creating client..."); $client = new \PushWebSocket\Client(uniqid(), $socket); $this->clients[] = $client; $this->sockets[] = $socket; $this->console("Client #{$client->getId()} is successfully created!"); }