<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WiFiAware",
  "identifier" : "/documentation/WiFiAware/WAPublisherListener/Action/connecting(to:from:datapath:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Wi-Fi Aware"
    ],
    "preciseIdentifier" : "s:9WiFiAware19WAPublisherListenerV6ActionV10connecting2to4from8datapathAeA20WAPublishableServiceV_AC7DevicesVAC18DatapathParametersVSgtFZ"
  },
  "title" : "connecting(to:from:datapath:)"
}
-->

# connecting(to:from:datapath:)

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

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

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`](/documentation/WiFiAware/WAPerformanceMode), in the optional “`datapath:`” parameter, or by using [`WAParameters`](/documentation/WiFiAware/WAParameters) that are written into the <doc://com.apple.documentation/documentation/Network/NWParameters> for the `NetworkListener`.

> Important: Each service must have the same ``doc://com.apple.wifiaware/documentation/WiFiAware/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 ``doc://com.apple.wifiaware/documentation/WiFiAware/WAPerformanceMode/bulk`` on both sides.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)