Skip to content

Commit

Permalink
net: perform the associated reconnect inside reconnect_hint instead o…
Browse files Browse the repository at this point in the history
…f outside

This allows session dervied classes more flexibility in implementation,
for example skipping a disconnect if the session is already
disconnected.

This also means that the only explicit call of reconnect on a
session_impl is now from session::exception_handler.
  • Loading branch information
jgriffiths committed Feb 9, 2022
1 parent d62efca commit 5482c2d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions src/ga_rust.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ namespace sdk {
}
GDK_LOG_SEV(log_level::info) << "reconnect_hint: " << (enable ? "enable" : "disable");
m_reconnect_restart = enable;
reconnect();
}

nlohmann::json ga_rust::call_session(const std::string& method, const nlohmann::json& input) const
Expand Down
1 change: 0 additions & 1 deletion src/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ namespace sdk {
exception_wrapper([&] {
auto p = get_nonnull_impl();
p->reconnect_hint(hint);
p->reconnect();
});
}

Expand Down

0 comments on commit 5482c2d

Please sign in to comment.