From 993d18e9612c53fbbb3c9e7d427874c7b37c285b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 14 Sep 2020 02:45:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Snowflake.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/System/Snowflake.php b/System/Snowflake.php index 892f8630..fe93510e 100644 --- a/System/Snowflake.php +++ b/System/Snowflake.php @@ -12,6 +12,7 @@ use Snowflake\Di\Container; use Snowflake\Exception\NotFindClassException; use Snowflake\Process\Process; use Swoole\Coroutine; +use Swoole\WebSocket\Server; class Snowflake { @@ -195,6 +196,16 @@ class Snowflake } + /** + * @return Server|\Swoole\Http\Server + * @throws + */ + public static function getWebSocket() + { + return static::app()->get('server')->getServer(); + } + + /** * @param string $class * @param array $params