diff --git a/include/rest_rpc/connection.h b/include/rest_rpc/connection.h index 3050aec..f24189c 100644 --- a/include/rest_rpc/connection.h +++ b/include/rest_rpc/connection.h @@ -49,7 +49,7 @@ class connection : public std::enable_shared_from_this, assert(data.size() < MAX_BUF_LEN); auto sp_data = std::make_shared(std::move(data)); std::weak_ptr weak = shared_from_this(); - asio::post([this, weak, sp_data, req_id, req_type] { + asio::post(socket_.get_executor(), [this, weak, sp_data, req_id, req_type] { auto conn = weak.lock(); if (conn) { response_interal(req_id, std::move(sp_data), req_type);