Skip to content

Commit 55e4105

Browse files
author
Paul Ehrhardt
authored
Merge pull request #3 from grandcentrix/develop
Merge latest develop into master for release 1.1.0
2 parents b3f0915 + cfa8daa commit 55e4105

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

GCXMulticastDNSKit/Discovery.swift

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ private class DiscoveryItem {
5959

6060

6161
/// 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 {
6363

6464
/// the configuration used to search
6565
public let configuration: DiscoveryConfiguration
6666

6767
/// the found service
6868
public let netService: NetService
6969

70-
init(configuration: DiscoveryConfiguration, netService: NetService) {
70+
public init(configuration: DiscoveryConfiguration, netService: NetService) {
7171
self.configuration = configuration
7272
self.netService = netService
7373
super.init()
@@ -120,7 +120,7 @@ private class DiscoveryItem {
120120

121121
/// the class to use to discover service on the network. Initialize a new instance with an array of
122122
/// configurations and start the search.
123-
@objc(GCXDiscovery) public class Discovery: NSObject {
123+
@objc(GCXDiscovery) open class Discovery: NSObject {
124124

125125

126126
/// the default search domain, empty string means .local.
@@ -141,9 +141,9 @@ private class DiscoveryItem {
141141

142142

143143
/// 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?
147147

148148
/// the designated initializer. creates a new discovery for the specified configurations
149149
///
@@ -207,7 +207,11 @@ extension Discovery {
207207
fileprivate func stopSearchingAndResolving() {
208208
let _ = items?.map {
209209
$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+
}
211215
}
212216

213217
items = nil

GCXMulticastDNSKit/DiscoveryConfiguration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import Foundation
2020

21-
@objc(GCXDiscoveryConfiguration) public class DiscoveryConfiguration: NSObject {
21+
@objc(GCXDiscoveryConfiguration) open class DiscoveryConfiguration: NSObject {
2222
public let serviceType: String
2323
public var serviceNamePrefix: String?
2424

0 commit comments

Comments
 (0)