diff --git a/include/rpc_client.hpp b/include/rpc_client.hpp index beea7c8..d79d159 100644 --- a/include/rpc_client.hpp +++ b/include/rpc_client.hpp @@ -236,6 +236,11 @@ namespace rest_rpc { template void async_call(const std::string& rpc_name, std::function cb, Args&& ... args) { + if (!has_connected_) { + error_callback(boost::asio::error::make_error_code(boost::asio::error::not_connected)); + return; + } + uint64_t cb_id = 0; { std::unique_lock lock(cb_mtx_);