forked from BranchMetrics/xcode-github
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathXGANetworkServiceBrowser.h
More file actions
54 lines (38 loc) · 1.55 KB
/
XGANetworkServiceBrowser.h
File metadata and controls
54 lines (38 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
@file XGANetworkServiceBrowser.h
@package xcode-github-app
@brief Browses for Bonjour (mDNS) services.
@author Edward Smith
@date September 2018
@copyright Copyright © 2018 Branch. All rights reserved.
*/
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
#pragma mark XGANetworkServiceHost
@interface XGANetworkServiceHost : NSObject
- (instancetype) init NS_UNAVAILABLE;
@property (strong, readonly) NSError*_Nullable error;
@property (strong, readonly) NSArray<NSString*>*names;
@property (strong, readonly) NSArray<NSString*>*addresses;
@end
#pragma mark - XGANetworkServiceBrowser
@protocol XGANetworkServiceBrowserDelegate;
// For xcode servers, the domain is "" and service "_xcs2p._tcp."
@interface XGANetworkServiceBrowser : NSObject
- (instancetype) init NS_UNAVAILABLE;
- (instancetype) initWithDomain:(NSString*)domain service:(NSString*)service NS_DESIGNATED_INITIALIZER;
- (void) startDiscovery;
- (void) stopDiscovery;
@property (strong, readonly) NSString*domain;
@property (strong, readonly) NSString*service;
@property (strong, readonly) NSArray<XGANetworkServiceHost*>*hosts;
@property (weak) id<XGANetworkServiceBrowserDelegate> delegate;
@end
#pragma mark - XGANetworkServiceBrowserDelegate
@protocol XGANetworkServiceBrowserDelegate <NSObject>
@optional
- (void) browser:(XGANetworkServiceBrowser*)browser discoveredHost:(XGANetworkServiceHost*)host;
@optional
- (void) browser:(XGANetworkServiceBrowser*)browser finishedWithError:(NSError*_Nullable)error;
@end
NS_ASSUME_NONNULL_END