---
title: "connecting(to:from:datapath:)"
framework: wifiaware
role: symbol
role_heading: Type Method
path: "wifiaware/wapublisherlistener/action/connecting(to:from:datapath:)"
---

# connecting(to:from:datapath:)

Publishes the provided service over Wi-Fi, enabling connections from the specified paired devices.

## Declaration

```swift
static func connecting(to myPublishingService: WAPublishableService, from pairedDevices: WAPublisherListener.Devices, datapath wifiAware: WAPublisherListener.DatapathParameters? = nil) -> WAPublisherListener.Action
```

## 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.

## Return Value

Return Value A new Action configuring this operation.

## Discussion

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. 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.
