From c1ef668adb7e9c85970464c4142eca7ce6f93c2d Mon Sep 17 00:00:00 2001 From: qicosmos Date: Fri, 25 Sep 2020 11:11:44 +0800 Subject: [PATCH] fix for auto reconnect --- include/rest_rpc/rpc_client.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/rest_rpc/rpc_client.hpp b/include/rest_rpc/rpc_client.hpp index ea71d92..576200e 100644 --- a/include/rest_rpc/rpc_client.hpp +++ b/include/rest_rpc/rpc_client.hpp @@ -124,6 +124,7 @@ namespace rest_rpc { void enable_auto_reconnect(bool enable = true) { enable_reconnect_ = enable; + reconnect_cnt_ = std::numeric_limits::max(); } void enable_auto_heartbeat(bool enable = true) { @@ -655,7 +656,7 @@ namespace rest_rpc { } if (enable_reconnect_) { - async_connect(); + async_reconnect(); } }