Kraken\Network\Websocket\WsServer::close PHP Method

close() protected method

Close a connection with an HTTP response.
protected close ( Kraken\Network\NetworkConnectionInterface $conn, integer $code = 400 ) : null
$conn Kraken\Network\NetworkConnectionInterface
$code integer
return null
    protected function close(NetworkConnectionInterface $conn, $code = 400)
    {
        $response = new HttpResponse($code, ['Sec-WebSocket-Version' => $this->wsDriver->getVersionHeader()]);
        $conn->send($response);
        $conn->close();
        unset($conn->WebSocket);
    }