There's getaddrinfo()
for blocking host resolution, but is there a non blocking method?
I don't think there is such a thing but you can always wrap it in a thread and use a semaphore to signal completion.
Linux has getaddrinfo_a()
. See the StackOverflow tag getaddrinfo-a, such as this question "How to use getaddrinfo_a to do async resolve with glibc". But I guess this isn't applicable for Windows.
There is a cross-platform library c-ares for asynchronous DNS requests, which says it runs on Windows. (I haven't tried it myself.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With