moonlight-ios/Limelight/Network/DiscoveryManager.h
Cameron Gutman 4aca666df4 Fix race condition that could cause pairing state to be lost
If a mDNS response for a host happened during the period where we
had removed the host from discovery, it would be re-added by mDNS
without the pairing cert. Now we no longer completely remove the host
and instead just remember that it's paused.
2020-04-18 17:16:53 -07:00

32 lines
864 B
Objective-C

//
// DiscoveryManager.h
// Moonlight
//
// Created by Diego Waxemberg on 1/1/15.
// Copyright (c) 2015 Moonlight Stream. All rights reserved.
//
#import "MDNSManager.h"
#import "TemporaryHost.h"
@protocol DiscoveryCallback <NSObject>
- (void) updateAllHosts:(NSArray*)hosts;
@end
@interface DiscoveryManager : NSObject <MDNSCallback>
- (id) initWithHosts:(NSArray*)hosts andCallback:(id<DiscoveryCallback>) callback;
- (void) startDiscovery;
- (void) stopDiscovery;
- (void) stopDiscoveryBlocking;
- (void) resetDiscoveryState;
- (BOOL) addHostToDiscovery:(TemporaryHost*)host;
- (void) removeHostFromDiscovery:(TemporaryHost*)host;
- (void) pauseDiscoveryForHost:(TemporaryHost *)host;
- (void) resumeDiscoveryForHost:(TemporaryHost *)host;
- (void) discoverHost:(NSString*)hostAddress withCallback:(void (^)(TemporaryHost*, NSString*))callback;
@end