handleDisconnect() public method

This is called before or after a socket is closed
public handleDisconnect ( Kraken\Network\NetworkConnectionInterface $conn )
$conn Kraken\Network\NetworkConnectionInterface The socket/connection that is closing/closed
コード例 #1
0
ファイル: WsServer.php プロジェクト: kraken-php/framework
 /**
  * @override
  * @inheritDoc
  */
 public function handleDisconnect(NetworkConnectionInterface $conn)
 {
     if ($this->connCollection->contains($conn)) {
         $decor = $this->connCollection[$conn];
         $this->connCollection->detach($conn);
         $this->wsServer->handleDisconnect($decor);
     }
 }
コード例 #2
0
ファイル: SocketServer.php プロジェクト: kraken-php/framework
 /**
  * Handler triggered when an existing connection is being closed.
  *
  * @param SocketInterface $socket
  */
 public function handleDisconnect($socket)
 {
     try {
         $this->component->handleDisconnect($socket->conn);
     } catch (Error $ex) {
         $this->handleError($socket, $ex);
     } catch (Exception $ex) {
         $this->handleError($socket, $ex);
     }
     unset($socket->conn);
 }
コード例 #3
0
ファイル: HttpSession.php プロジェクト: kraken-php/framework
 /**
  * @override
  * @inheritDoc
  */
 public function handleDisconnect(NetworkConnectionInterface $conn)
 {
     return $this->component->handleDisconnect($conn);
 }
コード例 #4
0
 /**
  * @override
  * @inheritDoc
  */
 public function handleDisconnect(NetworkConnectionInterface $conn)
 {
     if (!$this->isAddressBlocked($conn->getHost())) {
         $this->component->handleDisconnect($conn);
     }
 }
コード例 #5
0
ファイル: HttpServer.php プロジェクト: kraken-php/framework
 /**
  * @override
  * @inheritDoc
  */
 public function handleDisconnect(NetworkConnectionInterface $conn)
 {
     if ($conn->httpHeadersReceived) {
         $this->httpServer->handleDisconnect($conn);
     }
 }