3 ms·
If you do need the lower-level control, Apple does still recommend `getaddrinfo`. It handles NAT64 translation for IPv6-only carrier networks: https://develope
by conradev 2y ago
If you do need the lower-level control, Apple does still recommend `getaddrinfo`. It handles NAT64 translation for IPv6-only carrier networks:
https://developer.apple.com/library/archive/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html#//apple_ref/doc/uid/TP40010220-CH213-DontLinkElementID_4 https://developer.apple.com/library/archive/documentation/Ne...
- krackers 2y agoI'm actually surprised they suggest getaddrinfo() directly over the async CF wrapper.
- simscitizen 2y agoThat’s not the current documentation, as evidenced by the “archive” in the URL. If you want to stay at a lower level the recommendation these days is to use Network.framework. If you want something higher level then use CFNetwork (probably through the classes exported by Foundation like NSURLSession).
- conradev 2y agoI actually found it linked from here, which seems current: https://developer.apple.com/support/ipv6/ https://developer.apple.com/support/ipv6/ It is not best practice to use `getaddrinfo` for DNS resolution, for sure. But it is best practice to use it before connecting to an IP address directly because that address may need to be translated.