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