Skip to content

Commit

Permalink
Fix asio socket->set_option (#994)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenberry authored May 13, 2024
1 parent 2a58127 commit a0f538f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/glaze/ext/glaze_asio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,14 @@ namespace glz
{
ctx = std::make_shared<asio::io_context>(concurrency);
socket = std::make_shared<asio::ip::tcp::socket>(*ctx);
socket->set_option(asio::ip::tcp::no_delay(true));
asio::ip::tcp::resolver resolver{*ctx};
const auto endpoint = resolver.resolve(host, service);
std::error_code ec{};
asio::connect(*socket, endpoint, ec);
return ec;
if (ec) {
return ec;
}
return socket->set_option(asio::ip::tcp::no_delay(true), ec);
}

template <class Params>
Expand Down

0 comments on commit a0f538f

Please sign in to comment.