/** * When a new connection is opened it will be passed to this method * @param ConnectionInterface $conn The socket/connection that just connected to your application * @throws \Exception */ public function onOpen(ConnectionInterface $conn) { $wsUser = new WebsocketUser(); $wsUser->setConnection($conn); $this->users->attach($wsUser); $this->send(new AskIntroduction(), $wsUser); }