From 0300756a3af6f87ec272534db615e2e39bbfc08d Mon Sep 17 00:00:00 2001 From: Faaux Date: Mon, 21 Oct 2024 15:58:07 +0200 Subject: [PATCH] Resolve canonical_name to support "localhost" on windows --- include/async_mqtt5/impl/endpoints.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/async_mqtt5/impl/endpoints.hpp b/include/async_mqtt5/impl/endpoints.hpp index 6094ed6..63054eb 100644 --- a/include/async_mqtt5/impl/endpoints.hpp +++ b/include/async_mqtt5/impl/endpoints.hpp @@ -88,7 +88,11 @@ class resolve_op { _owner._connect_timer.expires_after(std::chrono::seconds(5)); auto timed_resolve = asioex::make_parallel_group( - _owner._resolver.async_resolve(ap.host, ap.port, asio::deferred), + _owner._resolver.async_resolve( + ap.host, + ap.port, + asio::ip::tcp::resolver::query::canonical_name, + asio::deferred), _owner._connect_timer.async_wait(asio::deferred) );