From 5ece88e5a8517fff5f6552d0e13057f38138d95a Mon Sep 17 00:00:00 2001 From: Simon-Janos Date: Fri, 30 Jun 2023 19:08:22 +0200 Subject: [PATCH] Removing IPv4 limitation from tcp_client (#2790) --- include/spdlog/details/tcp_client-windows.h | 2 +- include/spdlog/details/tcp_client.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/spdlog/details/tcp_client-windows.h b/include/spdlog/details/tcp_client-windows.h index 9d3647aa..968b2570 100644 --- a/include/spdlog/details/tcp_client-windows.h +++ b/include/spdlog/details/tcp_client-windows.h @@ -83,7 +83,7 @@ public: {}; ZeroMemory(&hints, sizeof(hints)); - hints.ai_family = AF_INET; // IPv4 + hints.ai_family = AF_UNSPEC; // To work with IPv4, IPv6, and so on hints.ai_socktype = SOCK_STREAM; // TCP hints.ai_flags = AI_NUMERICSERV; // port passed as as numeric value hints.ai_protocol = 0; diff --git a/include/spdlog/details/tcp_client.h b/include/spdlog/details/tcp_client.h index e4d7a48e..8b11dfd2 100644 --- a/include/spdlog/details/tcp_client.h +++ b/include/spdlog/details/tcp_client.h @@ -58,7 +58,7 @@ public: struct addrinfo hints {}; memset(&hints, 0, sizeof(struct addrinfo)); - hints.ai_family = AF_INET; // IPv4 + hints.ai_family = AF_UNSPEC; // To work with IPv4, IPv6, and so on hints.ai_socktype = SOCK_STREAM; // TCP hints.ai_flags = AI_NUMERICSERV; // port passed as as numeric value hints.ai_protocol = 0;