We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e69fb1 commit 7dfaac0Copy full SHA for 7dfaac0
src/ConnectionManager.php
@@ -60,6 +60,12 @@ public function connection(string $name = null): MqttClientContract
60
$name = $this->defaultConnection;
61
}
62
63
+ // Remove the connection if it is in a disconnected state.
64
+ // Doing this instead of simply reconnecting ensures the caller will get a fresh connection.
65
+ if (array_key_exists($name, $this->connections) && !$this->connections[$name]->isConnected()) {
66
+ unset($this->connections[$name]);
67
+ }
68
+
69
if (!array_key_exists($name, $this->connections)) {
70
$this->connections[$name] = $this->createConnection($name);
71
0 commit comments