You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
voidChargePoint::disconnect_websocket(websocketpp::close::status::value code) { if (this->websocket != nullptr) {
if (this->websocket->is_connected()) {
this->disable_automatic_websocket_reconnects = true;
this->websocket->disconnect(code);
}
}
}
The websocket is only disconnected when it is connected. That seems logical, but in the websocket->disconnect() function, things are done that also should be done when the websocket is not connected:
voidWebsocketBase::disconnect(websocketpp::close::status::value code) {
if (!this->initialized()) {
EVLOG_error << "Cannot disconnect a websocket that was not initialized";
return;
}
if (code == websocketpp::close::status::normal) {
this->shutting_down = true;
}
{
std::lock_guard<std::mutex> lk(this->reconnect_mutex);
if (this->reconnect_timer) {
this->reconnect_timer.get()->cancel();
}
}
if (this->ping_timer) {
this->ping_timer->stop();
}
EVLOG_info << "Disconnecting websocket...";
this->close(code, "");
}
Setting the shutting_down flag and cancel the reconnect_timer should also be done when the websocket is not connected.
The text was updated successfully, but these errors were encountered:
In
The websocket is only disconnected when it is connected. That seems logical, but in the websocket->disconnect() function, things are done that also should be done when the websocket is not connected:
Setting the shutting_down flag and cancel the reconnect_timer should also be done when the websocket is not connected.
The text was updated successfully, but these errors were encountered: