diff --git a/HttpServer/Http/Response.php b/HttpServer/Http/Response.php index e9cb2711..dc289229 100644 --- a/HttpServer/Http/Response.php +++ b/HttpServer/Http/Response.php @@ -295,6 +295,22 @@ class Response extends HttpService } + /** + * @param $clientId + * @param int $statusCode + * @param string $message + * @return mixed + */ + public function closeClient($clientId, $statusCode = 200, $message = ''): mixed + { + $socket = Snowflake::getWebSocket(); + if (!$socket->exist($clientId)) { + return true; + } + return $socket->close($clientId, true); + } + + /** * @param string $path * @param int $offset