Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation with upcoming Boost 1.87.0 #7073

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cho-m
Copy link

@cho-m cho-m commented Nov 20, 2024

Issue

Fixes #7072. Locally compiles for me in Homebrew environment patching on top of master or v5.27.0.

Since code base already uses boost::asio::io_context, that guarantees a minimum of Boost 1.66.0, so there shouldn't be compatibility issues.

Change based on boostorg/asio@b60e92b, e.g., example/cpp03/http/server/server.cpp has:

@@ -35,9 +35,9 @@ server::server(const std::string& address, const std::string& port,
   signals_.async_wait(boost::bind(&server::handle_stop, this));

   // Open the acceptor with the option to reuse the address (i.e. SO_REUSEADDR).
-  boost::asio::ip::tcp::resolver resolver(io_service_);
-  boost::asio::ip::tcp::resolver::query query(address, port);
-  boost::asio::ip::tcp::endpoint endpoint = *resolver.resolve(query);
+  boost::asio::ip::tcp::resolver resolver(io_context_);
+  boost::asio::ip::tcp::endpoint endpoint =
+    *resolver.resolve(address, port).begin();
   acceptor_.open(endpoint.protocol());
   acceptor_.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
   acceptor_.bind(endpoint);

Tasklist

Requirements / Relations

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build fails with upcoming Boost 1.87.0 due to Boost Asio removals
1 participant