-
Notifications
You must be signed in to change notification settings - Fork 26
Description
On macOS (where DNSSD is being used by default), queries for domains with multiple records, such as:
AsyncDNSResolver().queryAAAA(name: "iadsdk.apple.com.akadns.net")
normally return the two AAAA records associated with the domain. However, occasionally, only one is returned. It happens at roughly 1% of the time in my tests, but since this is a race, that number will fluctuate with the different timing conditions.
The core reason for this is that the library calls DNSServiceProcessResult precisely once. The callbacks are delivered as a result of this call, but DNSSD offers no guarantees about how many records will get provided per DNSServiceProcessResult invocation.
Additionally, while DNSSD provides kDNSServiceFlagsMoreComing, the flag is designed to reduce unnecessary UI updates only. It'd be fragile to use attach additional semantics to it.