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); }