When NSNetService calls its delegate’s netServiceDidResolveAddress: (QLKBrowser), there may be multiple addresses, in an unpredictable order.
Each address may be IPv4, or IPv6
QLKBrowserIPAddressFromData: will only work for IPv4 addresses. With a v6, it will return @"0.0.0.0"
If you connect to 0.0.0.0, you connect to localhost.
So, if NSNetService randomly happens to resolve an IPv6 address first, you may end up connecting to QLab on localhost instead – without any warning or errors.
My proposed fix solves this by supporting both v4 or v6 in IPAddressFromData: (F53OSC appears to work with both).
NSNetService
calls its delegate’snetServiceDidResolveAddress:
(QLKBrowser
), there may be multiple addresses, in an unpredictable order.QLKBrowser
IPAddressFromData:
will only work for IPv4 addresses. With a v6, it will return@"0.0.0.0"
0.0.0.0
, you connect to localhost.So, if
NSNetService
randomly happens to resolve an IPv6 address first, you may end up connecting to QLab on localhost instead – without any warning or errors.My proposed fix solves this by supporting both v4 or v6 in
IPAddressFromData:
(F53OSC appears to work with both).