mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2025-07-02 15:56:21 +00:00
Allow rediscovery of hosts after deletion without having to force quit the app
This commit is contained in:
parent
bd5e0ecc40
commit
b8631db5df
@ -21,6 +21,7 @@
|
||||
- (void) startDiscovery;
|
||||
- (void) stopDiscovery;
|
||||
- (void) stopDiscoveryBlocking;
|
||||
- (void) resetDiscoveryState;
|
||||
- (BOOL) addHostToDiscovery:(TemporaryHost*)host;
|
||||
- (void) removeHostFromDiscovery:(TemporaryHost*)host;
|
||||
- (void) discoverHost:(NSString*)hostAddress withCallback:(void (^)(TemporaryHost*, NSString*))callback;
|
||||
|
@ -69,6 +69,11 @@
|
||||
|
||||
}
|
||||
|
||||
- (void) resetDiscoveryState {
|
||||
// Allow us to rediscover hosts that were already found before
|
||||
[_mdnsMan forgetHosts];
|
||||
}
|
||||
|
||||
- (void) startDiscovery {
|
||||
if (shouldDiscover) {
|
||||
return;
|
||||
|
@ -21,6 +21,7 @@
|
||||
- (id) initWithCallback:(id<MDNSCallback>) callback;
|
||||
- (void) searchForHosts;
|
||||
- (void) stopSearching;
|
||||
- (void) forgetHosts;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -63,6 +63,10 @@ static NSString* NV_SERVICE_TYPE = @"_nvstream._tcp";
|
||||
[mDNSBrowser stop];
|
||||
}
|
||||
|
||||
- (void) forgetHosts {
|
||||
[services removeAllObjects];
|
||||
}
|
||||
|
||||
+ (NSString*)sockAddrToString:(NSData*)addrData {
|
||||
char addrStr[INET6_ADDRSTRLEN];
|
||||
struct sockaddr* addr = (struct sockaddr*)[addrData bytes];
|
||||
|
@ -829,6 +829,8 @@ static NSMutableSet* hostList;
|
||||
// This will kick off box art caching
|
||||
[self updateHosts];
|
||||
|
||||
// Reset state first so we can rediscover hosts that were deleted before
|
||||
[_discMan resetDiscoveryState];
|
||||
[_discMan startDiscovery];
|
||||
|
||||
// This will refresh the applist when a paired host is selected
|
||||
|
Loading…
x
Reference in New Issue
Block a user