TCP connection in with Wi-Fi aware framework never reaches ".ready" state

While developing our wifi-aware implementation we ran into a specific issue where TCP connections seem to never reach a "ready" state (ready to transfer data). It stays in “”preparing” state trying to connect for forever.

We tried to recreate a new TCP connection every time after the connection stays in "preparing" for longer than 10 seconds. This helps to "recover" eventually, but it only happens after 1.5 - 2 minutes.

Creating a completely new NetworkBrowser and NetworkListener doesn’t speed up this process.

The issue occurs when the browser and listener are setting up the NAN/TCP connection, at that time if the user opens the DevicePairingView it seems that it disrupts or interferes with the connection, entering an invalid state. From what we can see it takes around 2 minutes for it to recover, presumably this is when NAN drops the connection (timeout) and creates a new one.



STEPS TO REPRODUCE Reproduction steps:



  1. Open the app on 2 wifi-aware devices.


  2. Device 1 presses “Pair with device”. Device 2 navigates to “Receive” and presses the “”Pair with sender”.


  3. Complete the pairing process.



  4. Device 1 (Send) presses the start button.


  5. Device 2 (receive) presses start button, Directly after the button press, device 1 presses the “”Pair with sender” button


  6. Observe TCP connection never fully establishes (1.5 - 2 mins)

PLATFORM AND VERSION iOS

Development environment: Xcode 26.3, macOS 26.4.1

Run-time configuration: iOS 26.5

test project with a recording showing the issue: https://github.com/DeveloperNiels/WAIssue

Can you reproduce this with the Wi-Fi Aware sample code?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

TCP connection in with Wi-Fi aware framework never reaches ".ready" state
 
 
Q