diff --git a/include/rest_rpc/rpc_client.hpp b/include/rest_rpc/rpc_client.hpp index 8f6dd4b..75a4d4a 100644 --- a/include/rest_rpc/rpc_client.hpp +++ b/include/rest_rpc/rpc_client.hpp @@ -8,6 +8,7 @@ #include #include #include +#include #include using namespace rest_rpc::rpc_service; @@ -201,29 +202,6 @@ public: bool has_connected() const { return has_connected_; } // sync call -#if __cplusplus > 201402L - template - auto call(const std::string &rpc_name, Args &&...args) { - std::future future = - async_call(rpc_name, std::forward(args)...); - auto status = future.wait_for(std::chrono::milliseconds(TIMEOUT)); - if (status == std::future_status::timeout || - status == std::future_status::deferred) { - throw std::out_of_range("timeout or deferred"); - } - - if constexpr (std::is_void_v) { - future.get().as(); - } else { - return future.get().template as(); - } - } - - template - auto call(const std::string &rpc_name, Args &&...args) { - return call(rpc_name, std::forward(args)...); - } -#else template typename std::enable_if::value>::type call(const std::string &rpc_name, Args &&...args) { @@ -271,7 +249,6 @@ public: call(const std::string &rpc_name, Args &&...args) { return call(rpc_name, std::forward(args)...); } -#endif template future_result async_call(const std::string &rpc_name, @@ -629,7 +606,7 @@ private: auto &f = future_map_[req_id]; if (ec) { // LOG<set_value(req_result{""}); return;