/** * Handle open transport * * @param \Thruway\Transport\TransportInterface $transport */ public function onOpen(TransportInterface $transport) { $session = new Session($transport, $this->manager); // give the session the loop, just in case it wants to set a timer or something $session->setLoop($this->getLoop()); // TODO: add a little more detail to this (what kind and address maybe?) Logger::info($this, "New Session started " . json_encode($transport->getTransportDetails()) . ""); $this->sessions->attach($transport, $session); }
/** * @inheritdoc */ public function createNewSession(TransportInterface $transport) { $session = new Session($transport); $session->setLoop($this->getLoop()); return $session; }