This commit is contained in:
2021-03-30 19:44:04 +08:00
parent b84449d21b
commit b29df878e7
+16
View File
@@ -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