Skip to content

Commit

Permalink
Merge pull request #3 from grandcentrix/develop
Browse files Browse the repository at this point in the history
Merge latest develop into master for release 1.1.0
  • Loading branch information
Paul Ehrhardt authored Mar 23, 2017
2 parents b3f0915 + cfa8daa commit 55e4105
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions GCXMulticastDNSKit/Discovery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ private class DiscoveryItem {


/// a structure to enapsulate the result of a service discovery, this is returned
@objc(GCXDiscoveryService) public class DiscoveryService: NSObject {
@objc(GCXDiscoveryService) open class DiscoveryService: NSObject {

/// the configuration used to search
public let configuration: DiscoveryConfiguration

/// the found service
public let netService: NetService

init(configuration: DiscoveryConfiguration, netService: NetService) {
public init(configuration: DiscoveryConfiguration, netService: NetService) {
self.configuration = configuration
self.netService = netService
super.init()
Expand Down Expand Up @@ -120,7 +120,7 @@ private class DiscoveryItem {

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


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


/// the completion closures
fileprivate var discoverHandler: DiscoveryDiscoverHandler?
fileprivate var failHandler: DiscoveryFailHandler?
fileprivate var serviceRemovedHandler: DiscoveryServiceRemovedHandler?
public var discoverHandler: DiscoveryDiscoverHandler?
public var failHandler: DiscoveryFailHandler?
public var serviceRemovedHandler: DiscoveryServiceRemovedHandler?

/// the designated initializer. creates a new discovery for the specified configurations
///
Expand Down Expand Up @@ -207,7 +207,11 @@ extension Discovery {
fileprivate func stopSearchingAndResolving() {
let _ = items?.map {
$0.netServiceBrowser.stop()
let _ = $0.netServices.map { $0.stop() }
$0.netServiceBrowser.delegate = nil
let _ = $0.netServices.map {
$0.stop()
$0.delegate = nil
}
}

items = nil
Expand Down
2 changes: 1 addition & 1 deletion GCXMulticastDNSKit/DiscoveryConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import Foundation

@objc(GCXDiscoveryConfiguration) public class DiscoveryConfiguration: NSObject {
@objc(GCXDiscoveryConfiguration) open class DiscoveryConfiguration: NSObject {
public let serviceType: String
public var serviceNamePrefix: String?

Expand Down

0 comments on commit 55e4105

Please sign in to comment.