mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-18 14:40:56 +00:00
Add stop function to MDNSManager
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
- (id) initWithCallback:(id<MDNSCallback>) callback;
|
- (id) initWithCallback:(id<MDNSCallback>) callback;
|
||||||
- (void) searchForHosts;
|
- (void) searchForHosts;
|
||||||
|
- (void) stopSearching;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
@@ -31,10 +31,15 @@ static NSString* NV_SERVICE_TYPE = @"_nvstream._tcp";
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void) searchForHosts {
|
- (void) searchForHosts {
|
||||||
NSLog(@"Searching for hosts...");
|
NSLog(@"Starting mDNS discovery");
|
||||||
[mDNSBrowser searchForServicesOfType:NV_SERVICE_TYPE inDomain:@""];
|
[mDNSBrowser searchForServicesOfType:NV_SERVICE_TYPE inDomain:@""];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) stopSearching {
|
||||||
|
NSLog(@"Stopping mDNS discovery");
|
||||||
|
[mDNSBrowser stop];
|
||||||
|
}
|
||||||
|
|
||||||
- (NSArray*) getFoundHosts {
|
- (NSArray*) getFoundHosts {
|
||||||
NSMutableArray* hosts = [[NSMutableArray alloc] init];
|
NSMutableArray* hosts = [[NSMutableArray alloc] init];
|
||||||
for (NSNetService* service in services) {
|
for (NSNetService* service in services) {
|
||||||
|
|||||||
Reference in New Issue
Block a user