mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-10-25 13:31:47 +00:00
fixed MDNS discovered hosts getting stuck in infinite loop
This commit is contained in:
1 parent
94d399e275
commit
fe64d70577
3 files changed
+45
-37
No files matched your search
@@ -105,12 +105,15 @@
|
||||
DataManager* dataMan = [[DataManager alloc] init];
|
||||
// Discover the hosts before adding to eliminate duplicates
|
||||
for (Host* host in hosts) {
|
||||
NSLog(@"Found host through MDNS: %@:", host.name);
|
||||
// Since this is on a background thread, we do not need to use the opQueue
|
||||
NSOperation* worker = [self createWorkerForHost:host];
|
||||
[worker main];
|
||||
DiscoveryWorker* worker = (DiscoveryWorker*)[self createWorkerForHost:host];
|
||||
[worker discoverHost];
|
||||
if ([self addHostToDiscovery:host]) {
|
||||
NSLog(@"Adding host to discovery: %@", host.name);
|
||||
[_callback updateAllHosts:_hostQueue];
|
||||
} else {
|
||||
NSLog(@"Not adding host to discovery: %@", host.name);
|
||||
[dataMan removeHost:host];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user