connecting(to:from:datapath:)
Publishes the provided service over Wi-Fi, enabling connections from the specified paired devices.
Declaration
static func connecting(to myPublishingService: WAPublishableService, from pairedDevices: WAPublisherListener.Devices, datapath wifiAware: WAPublisherListener.DatapathParameters? = nil) -> WAPublisherListener.ActionParameters
- myPublishingService:
The service the publisher hosts, and accept connections to.
- pairedDevices:
The remote devices to accept connections from. The
NetworkListenerisn’t activated if the system doesn’t specify any devices. - wifiAware:
The parameters specifying the initial Wi-Fi Aware data path configuration for any resulting connections, or
nilto apply default parameters.
Return Value
A new Action configuring this operation.
Discussion
When publishing, the NetworkListener provides a NetworkConnection object for each paired device that connects.
You can set the data path parameters, including the WAPerformanceMode, in the optional “datapath:” parameter, or by using WAParameters that are written into the NWParameters for the NetworkListener.