@@ -59,15 +59,15 @@ private class DiscoveryItem {
59
59
60
60
61
61
/// a structure to enapsulate the result of a service discovery, this is returned
62
- @objc ( GCXDiscoveryService) public class DiscoveryService : NSObject {
62
+ @objc ( GCXDiscoveryService) open class DiscoveryService : NSObject {
63
63
64
64
/// the configuration used to search
65
65
public let configuration : DiscoveryConfiguration
66
66
67
67
/// the found service
68
68
public let netService : NetService
69
69
70
- init ( configuration: DiscoveryConfiguration , netService: NetService ) {
70
+ public init ( configuration: DiscoveryConfiguration , netService: NetService ) {
71
71
self . configuration = configuration
72
72
self . netService = netService
73
73
super. init ( )
@@ -120,7 +120,7 @@ private class DiscoveryItem {
120
120
121
121
/// the class to use to discover service on the network. Initialize a new instance with an array of
122
122
/// configurations and start the search.
123
- @objc ( GCXDiscovery) public class Discovery : NSObject {
123
+ @objc ( GCXDiscovery) open class Discovery : NSObject {
124
124
125
125
126
126
/// the default search domain, empty string means .local.
@@ -141,9 +141,9 @@ private class DiscoveryItem {
141
141
142
142
143
143
/// the completion closures
144
- fileprivate var discoverHandler : DiscoveryDiscoverHandler ?
145
- fileprivate var failHandler : DiscoveryFailHandler ?
146
- fileprivate var serviceRemovedHandler : DiscoveryServiceRemovedHandler ?
144
+ public var discoverHandler : DiscoveryDiscoverHandler ?
145
+ public var failHandler : DiscoveryFailHandler ?
146
+ public var serviceRemovedHandler : DiscoveryServiceRemovedHandler ?
147
147
148
148
/// the designated initializer. creates a new discovery for the specified configurations
149
149
///
@@ -207,7 +207,11 @@ extension Discovery {
207
207
fileprivate func stopSearchingAndResolving( ) {
208
208
let _ = items? . map {
209
209
$0. netServiceBrowser. stop ( )
210
- let _ = $0. netServices. map { $0. stop ( ) }
210
+ $0. netServiceBrowser. delegate = nil
211
+ let _ = $0. netServices. map {
212
+ $0. stop ( )
213
+ $0. delegate = nil
214
+ }
211
215
}
212
216
213
217
items = nil
0 commit comments