@@ -154,11 +154,11 @@ public:
}
};
channel->onclose = [this]() {
+ bool reconnect = reconn_setting != NULL;
if (onConnection) {
onConnection(channel);
- // reconnect
- if (reconn_setting) {
+ if (reconnect) {
startReconnect();