let ciaoServer = CiaoServer(type: ServiceType.tcp("ciaoserver"))
ciaoServer.start { (success) in
print("Server started:", success)
}
ciaoServer.txtRecord = ["someKey": "someValue"]
Browser
let ciaoBrowser = CiaoBrowser()
// get notified when a service is found
browser.serviceFoundHandler = { service in
print("Service found")
print(service)
}
// register to automatically resolve a service
browser.serviceResolvedHandler = { service in
print("Service resolved")
print(service)
print(service.hostName)
print(service.txtRecordDictionary)
}
browser.serviceRemovedHandler = { service in
print("Service removed")
print(service)
}
ciaoBrowser.browse(type: type)
Resolver
Optionally you can also use the resolver to any NetService instance
var resolver = CiaoResolver(service: service)
resolver?.resolve(withTimeout: 0) { (result: Result<NetService, ErrorDictionary>) in
print(result)
}
Contributing
Fork it!
Create your feature branch: git checkout -b my-new-feature
Commit your changes: git commit -am 'Add some feature'
Push to the branch: git push origin my-new-feature
Submit a pull request :D
License
Ciao is released under the MIT license. See LICENSE for details.
Ciao
Lib to publish and find services using mDNS
Requirements
Installation
CocoaPods
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
To integrate Ciao into your Xcode project using CocoaPods, specify it in your
Podfile
:Then, run the following command:
Carthage
Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.
You can install Carthage with Homebrew using the following command:
To integrate Ciao into your Xcode project using Carthage, specify it in your
Cartfile
:Swift Package Manager
To use Ciao as a Swift Package Manager package just add the following in your Package.swift file.
Usage
Server
Browser
Resolver
Optionally you can also use the resolver to any NetService instance
Contributing
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
License
Ciao is released under the MIT license. See LICENSE for details.