libplctag
libplctag copied to clipboard
Change DNS resolution to be async
There are some other possibilities than the old POSIX gethostbyname() call. We need async resolution and cancellation.
- glibc has getaddrinfo_a / gai_cancel
- Windows has GetAddrInfoExW / GetAddrInfoExCancel
- OpenBSD has getaddrinfo_async / asr_abort
- macOS has CFHostStartInfoResolution / CFHostCancelInfoResolution
- FreeBSD has dnsres_getaddrinfo, but no cancellation support
(cribbed from a Zig announcement)
It is unfortunate that the BSDs are not unified in this.