Swiftpack.co - randymarsh77/bonjour as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by randymarsh77.
randymarsh77/bonjour 1.2.2
Convenience task-based API around `NetServices`.
⭐️ 0
🕓 3 years ago
.package(url: "https://github.com/randymarsh77/bonjour.git", from: "1.2.2")

Bonjour

Convenience task-based API around NetServices.

license GitHub release SPM Build Status codebeat badge

Example

import Foundation
import Async
import Bonjour
import Using

let serviceType: ServiceType = .Unregistered(identifier: "_myService")

let bSettings = BroadcastSettings(
	name: "Bonjour World!",
	serviceType: serviceType,
	serviceProtocol: .TCP,
	domain: .AnyDomain,
	port: 1234
)

let qSettings = QuerySettings(
	serviceType: serviceType,
	serviceProtocol: .TCP,
	domain: .AnyDomain
)

using (Bonjour.Broadcast(bSettings)) {
	let services = await(Bonjour.FindAll(qSettings))
	print("Found \(services.count) service\(services.count == 1 ? "" : "s")")
}

GitHub

link
Stars: 0
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

7 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics