From 328fc92e2347c72464d52f9d4fd3306061e68ee6 Mon Sep 17 00:00:00 2001 From: qRoC Date: Wed, 28 Aug 2019 14:04:12 +0300 Subject: [PATCH] [FIX] getConnect returns not valid socket --- src/Broker.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Broker.php b/src/Broker.php index d3ddc7aa..1a7c7cdc 100644 --- a/src/Broker.php +++ b/src/Broker.php @@ -111,13 +111,13 @@ public function getDataConnect($key, $modeSync = false) public function getConnect($key, $type, $modeSync = false) { - if (isset($this->{$type}[$key])) { + if (isset($this->{$type}[$key]) && $this->{$type}[$key]->isResource()) { return $this->{$type}[$key]; } if (isset($this->brokers[$key])) { $hostname = $this->brokers[$key]; - if (isset($this->{$type}[$hostname])) { + if (isset($this->{$type}[$hostname]) && $this->{$type}[$hostname]->isResource()) { return $this->{$type}[$hostname]; } }