Compare commits
2 Commits
v1.0.0-rc2
...
v1.0.1
Author | SHA1 | Date | |
---|---|---|---|
7dfaac06e4 | |||
9e69fb1e45 |
@ -22,7 +22,7 @@
|
||||
"php": "^7.4|^8.0",
|
||||
"illuminate/config": "~7.0|~8.0",
|
||||
"illuminate/support": "~7.0|~8.0",
|
||||
"php-mqtt/client": "v1.0.0-rc1"
|
||||
"php-mqtt/client": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"squizlabs/php_codesniffer": "^3.5"
|
||||
|
@ -60,6 +60,12 @@ class ConnectionManager
|
||||
$name = $this->defaultConnection;
|
||||
}
|
||||
|
||||
// Remove the connection if it is in a disconnected state.
|
||||
// Doing this instead of simply reconnecting ensures the caller will get a fresh connection.
|
||||
if (array_key_exists($name, $this->connections) && !$this->connections[$name]->isConnected()) {
|
||||
unset($this->connections[$name]);
|
||||
}
|
||||
|
||||
if (!array_key_exists($name, $this->connections)) {
|
||||
$this->connections[$name] = $this->createConnection($name);
|
||||
}
|
||||
|
Reference in New Issue
Block a user