Fix infinite loop of retries when multiple hosts are not resolving

This commit is contained in:
Cameron Gutman
2023-02-02 21:56:26 -06:00
parent 4f03dd8c08
commit 9a03dd184a

View File

@@ -240,7 +240,7 @@ static NSString* NV_SERVICE_TYPE = @"_nvstream._tcp";
[NSTimer scheduledTimerWithTimeInterval:2.0
target:self
selector:@selector(retryResolveTimerCallback:)
userInfo:nil
userInfo:sender
repeats:NO];
}
@@ -294,12 +294,12 @@ static NSString* NV_SERVICE_TYPE = @"_nvstream._tcp";
return;
}
Log(LOG_I, @"Retrying mDNS resolution");
for (NSNetService* service in services) {
if (service.hostName == nil) {
[service setDelegate:self];
[service resolveWithTimeout:5];
}
NSNetService* service = timer.userInfo;
Log(LOG_I, @"Retrying mDNS resolution for %@", service);
if (service.hostName == nil) {
[service setDelegate:self];
[service resolveWithTimeout:5];
}
}