Skip to content

Commit

Permalink
fix gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
poor-circle committed Jan 17, 2025
1 parent fe93d38 commit 7cde42f
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions include/ylt/coro_rpc/impl/coro_rpc_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,15 +715,14 @@ class coro_rpc_client {
if (!control->has_closed_.compare_exchange_strong(expected, true)) {
return;
}
asio::dispatch(control->executor_.get_asio_executor(),
[control]() {
assert(&control->executor_.get_asio_executor().context() ==
&control->socket_.get_executor().context());
control->has_closed_ = true;
asio::error_code ec;
control->socket_.shutdown(asio::ip::tcp::socket::shutdown_both, ec);
control->socket_.close(ec);
});
asio::dispatch(control->executor_.get_asio_executor(), [control]() {
assert(&control->executor_.get_asio_executor().context() ==
&control->socket_.get_executor().context());
control->has_closed_ = true;
asio::error_code ec;
control->socket_.shutdown(asio::ip::tcp::socket::shutdown_both, ec);
control->socket_.close(ec);
});
return;
}

Expand All @@ -733,18 +732,19 @@ class coro_rpc_client {
if (!control->has_closed_.compare_exchange_strong(expected, true)) {
co_return;
}
co_await coro_io::post([control]() {
assert(&control->executor_.get_asio_executor().context() ==
&control->socket_.get_executor().context());
control->has_closed_ = true;
asio::error_code ec;
control->socket_.shutdown(asio::ip::tcp::socket::shutdown_both, ec);
control->socket_.close(ec);
},&control->executor_);
co_await coro_io::post(
[control = control.get()]() {
assert(&control->executor_.get_asio_executor().context() ==
&control->socket_.get_executor().context());
control->has_closed_ = true;
asio::error_code ec;
control->socket_.shutdown(asio::ip::tcp::socket::shutdown_both, ec);
control->socket_.close(ec);
},
&control->executor_);
co_return;
}


#ifdef UNIT_TEST_INJECT
public:
coro_rpc::err_code sync_connect(const std::string &host,
Expand Down

0 comments on commit 7cde42f

Please sign in to comment.