Call onDisconnect callbacks when disconnected
Summary: I noticed from the diagnostics screen that onDisconnected was never being called when sonar disconnects. Reviewed By: danielbuechele Differential Revision: D9265562 fbshipit-source-id: afd070126c6ef02a98c8dbc6589b6f9b8b83a730
This commit is contained in:
committed by
Facebook Github Bot
parent
a9b8c3d2c9
commit
800302b433
@@ -118,7 +118,7 @@ void SonarClient::onConnected() {
|
|||||||
|
|
||||||
void SonarClient::onDisconnected() {
|
void SonarClient::onDisconnected() {
|
||||||
SONAR_LOG("SonarClient::onDisconnected");
|
SONAR_LOG("SonarClient::onDisconnected");
|
||||||
auto step = sonarState_->start("onDisconnected callbacks");
|
auto step = sonarState_->start("Trigger onDisconnected callbacks");
|
||||||
std::lock_guard<std::mutex> lock(mutex_);
|
std::lock_guard<std::mutex> lock(mutex_);
|
||||||
connected_ = false;
|
connected_ = false;
|
||||||
performAndReportError([this, step]() {
|
performAndReportError([this, step]() {
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ class ConnectionEvents : public rsocket::RSocketConnectionEvents {
|
|||||||
if (!websocket_->isOpen_)
|
if (!websocket_->isOpen_)
|
||||||
return;
|
return;
|
||||||
websocket_->isOpen_ = false;
|
websocket_->isOpen_ = false;
|
||||||
websocket_->connectionIsTrusted_ = false;
|
|
||||||
if (websocket_->connectionIsTrusted_) {
|
if (websocket_->connectionIsTrusted_) {
|
||||||
|
websocket_->connectionIsTrusted_ = false;
|
||||||
websocket_->callbacks_->onDisconnected();
|
websocket_->callbacks_->onDisconnected();
|
||||||
}
|
}
|
||||||
websocket_->reconnect();
|
websocket_->reconnect();
|
||||||
|
|||||||
Reference in New Issue
Block a user