libplctag icon indicating copy to clipboard operation
libplctag copied to clipboard

Change DNS resolution to be async

Open kyle-github opened this issue 2 months ago • 0 comments

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.

kyle-github avatar Oct 20 '25 19:10 kyle-github