From 72a6656647f509c31fc4f1ba08f5bf3bb469ef71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 1 Sep 2020 15:31:22 +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 --- http-server/Events/Http.php | 1 + http-server/Events/Service.php | 1 + http-server/Events/WebSocket.php | 6 ++---- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/http-server/Events/Http.php b/http-server/Events/Http.php index e40d6620..865bb5a4 100644 --- a/http-server/Events/Http.php +++ b/http-server/Events/Http.php @@ -37,6 +37,7 @@ class Http extends Server */ public function __construct($application, $host, $port = null, $mode = null, $sock_type = null) { + $application->set($host . ':' . $port, $this); $this->application = $application; parent::__construct($host, $port, $mode, $sock_type); } diff --git a/http-server/Events/Service.php b/http-server/Events/Service.php index 644a5448..86a5c54b 100644 --- a/http-server/Events/Service.php +++ b/http-server/Events/Service.php @@ -45,6 +45,7 @@ abstract class Service extends Server */ public function __construct($application, $host, $port = null, $mode = null, $sock_type = null) { + $application->set($host . ':' . $port, $this); $this->application = $application; parent::__construct($host, $port, $mode, $sock_type); } diff --git a/http-server/Events/WebSocket.php b/http-server/Events/WebSocket.php index e899844a..9eeeab13 100644 --- a/http-server/Events/WebSocket.php +++ b/http-server/Events/WebSocket.php @@ -48,6 +48,7 @@ class WebSocket extends Server */ public function __construct($application, $host, $port = null, $mode = null, $sock_type = null) { + $application->set($host . ':' . $port, $this); $this->application = $application; parent::__construct($host, $port, $mode, $sock_type); } @@ -67,10 +68,7 @@ class WebSocket extends Server { parent::set($settings); - $application = Snowflake::get(); - $application->set(WebSocket::class, $this); - - ServerManager::set($this, $settings, $application, $events, $config); + ServerManager::set($this, $settings, $this->application, $events, $config); }