RxGCXMulticastDNSKit 1.4.0

RxGCXMulticastDNSKit 1.4.0

由以下维护者维护:Christian NetthöfelPaul EhrhardtJan Rose (GCX)Paul Ehrhardt



 
依赖关系
GCXMulticastDNSKit~> 1.3.0
RxSwift~> 6.0.0
 

RxGCXMulticastDNSKit

License Release Carthage compatible Cocoapods compatible

这是一个 GCXMulticastDNSKit 的简单 RxSwift 包装。

需求

RxSwift @ v5.x GCXMulticastDNSKit @ v1.3.1

使用

public enum DiscoveryResult {
    case serviceFound(DiscoveryService)
    case failure(DiscoveryConfiguration, DiscoveryError)
    case serviceRemoved(DiscoveryService)
}
let disposeBag = DisposeBag()

...

let configuration = DiscoveryConfiguration(serviceType: "_http._tcp", serviceNamePrefix: "GCXDNSKitTest")
Discovery.rx.service(configurations: [ configuration ] ).subscribe(onNext: { result in
	  switch (result) {
            case .failure(let configuration, let error):
            	// handle the error
                break
            case .serviceFound(let service):
            	// we got a service
                break
            case .serviceRemoved(let service):
            	// a service disappeared
                break
            }
    }).addDisposableTo(disposeBag)

安装

Carthage

git "https://github.com/grandcentrix/RxGCXMulticastDNSKit.git"

Cocoapods

use_frameworks!

pod 'RxGCXMulticastDNSKit'

许可

Copyright 2017 grandcentrix GmbH

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   https://apache.ac.cn/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.