From 0d1e02616b924a91648de10ebb584d7734bdd1a3 Mon Sep 17 00:00:00 2001 From: qicosmos Date: Thu, 4 Jul 2019 11:54:53 +0800 Subject: [PATCH] update for connect --- include/rpc_client.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/rpc_client.hpp b/include/rpc_client.hpp index 547f836..6549e62 100644 --- a/include/rpc_client.hpp +++ b/include/rpc_client.hpp @@ -123,6 +123,9 @@ namespace rest_rpc { } bool connect(size_t timeout = 1) { + if (has_connected_) + return true; + assert(port_ != 0); async_connect(); return wait_conn(timeout);