Server
public class Server : NSObject, NetServiceDelegate
Use the Device instance to manage the setup code, accessories and controller pairings. You can assign a delegate to be notified of certain events. The Server manages IP connectivity and network discovery advertisements.
Undocumented
-
Boot a new Server for the given Device and start advertising.
Declaration
Swift
public init( device: Device, listenPort requestedPort: Int = 0, worker: EventLoopGroup? = nil ) throwsParameters
devicethe device to advertise
listenPort(optional) the port to listen on, if 0 a random port will be chosen (default: 0)
worker(optional) by default a new
MultiThreadedEventLoopGrouploop is created having the samenumberOfThreadsas theSystem.coreCount, provide your ownEventLoopGroupfor more control -
Stop advertising
Declaration
Swift
public func stop() throws -
Undocumented
Declaration
Swift
public func netServiceDidPublish(_ sender: NetService) -
Undocumented
Declaration
Swift
public func netService(_ sender: NetService, didNotPublish errorDict: [String : NSNumber])
View on GitHub
Install in Dash
Server Class Reference