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 ) throws
Parameters
device
the 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
MultiThreadedEventLoopGroup
loop is created having the samenumberOfThreads
as theSystem.coreCount
, provide your ownEventLoopGroup
for 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])