Skip to content

Commit

Permalink
fix for auto reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos committed Sep 25, 2020
1 parent 3dc8332 commit c1ef668
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/rest_rpc/rpc_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ namespace rest_rpc {

void enable_auto_reconnect(bool enable = true) {
enable_reconnect_ = enable;
reconnect_cnt_ = std::numeric_limits<int>::max();
}

void enable_auto_heartbeat(bool enable = true) {
Expand Down Expand Up @@ -655,7 +656,7 @@ namespace rest_rpc {
}

if (enable_reconnect_) {
async_connect();
async_reconnect();
}
}

Expand Down

0 comments on commit c1ef668

Please sign in to comment.