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:
-
Open the app on 2 wifi-aware devices.
-
Device 1 presses “Pair with device”. Device 2 navigates to “Receive” and presses the “”Pair with sender”.
-
Complete the pairing process.
-
Device 1 (Send) presses the start button.
-
Device 2 (receive) presses start button, Directly after the button press, device 1 presses the “”Pair with sender” button
-
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
Yes I have managed to reproduced the issue even with the sample app.
OK. One way or another, that means that the problem is on our side of the fence. Please file a bug about this, and then post your bug number, just for the record.
In your bug report:
- Include your steps to reproduce.
- A sysdiagnose log from both devices in play, taken immediately after reproduce the problem.
See our Bug Reporting > Profiles and Logs page for more about sysdiagnose logs.
I have more info on filing Wi-Fi bug reports in Filing a Wi-Fi Bug Report, but I suspect that just a vanilla sysdiagnose log is sufficient in this case.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"