Last active
February 19, 2025 00:08
-
-
Save virtuosonic/2861040e918286582bff9184ed009c33 to your computer and use it in GitHub Desktop.
chkaddrinfo.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ws2tcpip.h" | |
int main() { | |
addrinfo hints = {}, *res; | |
hints.ai_family = AF_INET; | |
int status = getaddrinfo("test.mosquitto.org", nullptr, &hints, &res); | |
if (status != 0) { | |
std::cerr << "getaddrinfo failed: " << gai_strerror(status) << std::endl; | |
} else { | |
std::cout << "getaddrinfo succeeded" << std::endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment