Example #1
0
 public function handleEnd($conn)
 {
     try {
         $this->app->onClose($conn->decor);
     } catch (\Exception $e) {
         $this->handleError($e, $conn);
     }
 }
 /**
  * {@inheritdoc}
  */
 public function onClose(ConnectionInterface $conn)
 {
     if ($this->connections->contains($conn)) {
         $decor = $this->connections[$conn];
         $this->connections->detach($conn);
         $this->_decorating->onClose($decor);
     }
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function onClose(ConnectionInterface $conn)
 {
     if ($this->connections->contains($conn)) {
         $decor = $this->connections[$conn];
         $this->connections->detach($conn);
     }
     // WS::onOpen is not called when the socket connects, it's call when the handshake is done
     // The socket could close before WS calls onOpen, so we need to check if we've "opened" it for the developer yet
     if (isset($decor)) {
         $this->_decorating->onClose($decor);
     }
 }
Example #4
0
 /**
  * {@inheritdoc}
  */
 function onClose(ConnectionInterface $conn)
 {
     if (!$this->isBlocked($conn->remoteAddress)) {
         $this->_decorating->onClose($conn);
     }
 }
Example #5
0
 /**
  * {@inheritdoc}
  */
 function onClose(ConnectionInterface $conn)
 {
     // "close" session for Connection
     return $this->_app->onClose($conn);
 }