The structure that configures the Wi-Fi Aware publisher operation that the network listener performs.
The configuration includes the service and devices it operates on.
The ``WAPublisherListener/Action`` is the first component of the `.wifiAware()` instruction to a `NetworkListener`.
The code below is an example of creating a `NetworkListener`:
```swift
NetworkListener(for: .wifiAware( .connecting(to:service, from:.selected(devices)) ) )
````
Publishes the provided service over Wi-Fi, enabling connections from the specified paired devices.
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 <doc://com.apple.documentation/documentation/Network/NWParameters> for the `NetworkListener`.
> Important: Each service must have the same ``WAPerformanceMode`` on both the `NetworkBrowser` (subscriber) and `NetworkListener` (publisher) sides of the connection, or the resulting performance behavior is undefined. If not specified, the performance mode defaults to ``WAPerformanceMode/bulk`` on both sides.
- Parameters:
- myPublishingService: The service the publisher hosts, and accept connections to.
- pairedDevices: The remote devices to accept connections from. The `NetworkListener` isn'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 `nil` to apply default parameters.
- Returns: A new `Action` configuring this operation.
Make additional network connections over a preexisting Wi-Fi Aware datapath, without publishing or advertising any services over Wi-Fi Aware.
Your app should setup it's first connection to a device using Wi-Fi Aware service discovery. Apps can do so by defining a single "control" service used for initial discovery and connection, and creating a `NetworkListener` for that service via ``connecting(to:from:datapath:)``. Subsequent connections may then use a `.addingConnections` `NetworkListener`to quickly connect without going through the service discovery process again.
The listener will be limited to accepting connections from the paired devices specified.
>Important: Your app must have at least one pre-existing ``Network/NetworkConnection`` to a remote device, before it can make additional connections to an `.addingConnections` `NetworkListener` on that device.
Example Usage:
```swift
// Create a listener to add new connections
let listener = try NetworkListener(for:
.wifiAware(.addingConnections(from: .matching(devices))),
using: .parameters({
TCP()
}))
// Get the port number once the listener is in the ready state
guard let port = listener.port { return }
// Send the port number to the client device(s) over the control connection.
```
- Parameter pairedDevices: The remote devices to accept connections from. The `NetworkListener` isn't activated if the system doesn't specify any devices.
- Returns: A new `Action` that configures the listener to accept network connections from specified paired devices.