/** @inheritdoc */ public function onOpen(ConnectionInterface $conn) { Logger::debug($this, "RatchetTransportProvider::onOpen"); $transport = new RatchetTransport($conn, $this->loop); // this will need to be a little more dynamic at some point $transport->setSerializer(new JsonSerializer()); $transport->setTrusted($this->trusted); $session = $this->router->createNewSession($transport); $this->sessions->attach($conn, $session); $this->router->getEventDispatcher()->dispatch("connection_open", new ConnectionOpenEvent($session)); }
/** * When a new connection is opened it will be passed to this method * * @param \Ratchet\ConnectionInterface $conn The socket/connection that just connected to your application * @throws \Exception */ public function onOpen(ConnectionInterface $conn) { Logger::debug($this, "RatchetTransportProvider::onOpen"); $transport = new RatchetTransport($conn, $this->loop); // this will need to be a little more dynamic at some point $transport->setSerializer(new JsonSerializer()); $transport->setTrusted($this->trusted); $this->transports->attach($conn, $transport); $this->peer->onOpen($transport); // $session = new Session($conn); // // $this->sessions->attach($conn, $session); }