Issue with Native Socket Connection (Error 65) over WiFi Aware on iOS

Dear Apple: 1、We want to create a socket application using the C language interface on the WiFi Aware channel, utilizing native socket APIs such as socket, connect, bind, etc., to transmit data through the established WiFi Aware channel. However, we wrote a demo and tested it. On the iOS side, when initiating a socket connect, we received error code 65. We also used the IPv6 protocol. We would like to ask for help: Is it impossible to use native socket APIs for programming on the WiFi Aware channel? 2、If native sockets are not available, which interfaces are recommended for WiFi Aware communication on iOS?

Thanks.

Answered by DTS Engineer in 898179022

I can answer this part immediately:

which interfaces are recommended for Wi-Fi Aware communication on iOS?

Network framework. It has three different interfaces (the C interface, the original Swift interface, and the new Swift interface), all of which should work over Wi-Fi Aware.

This isn’t a hard question because Network framework is our preferred interface for TCP communications in general. BSD Sockets is supported, but it’s mainly there for compatibility. See TN3151 Choosing the right networking API.

Share and Enjoy

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

I can answer this part immediately:

which interfaces are recommended for Wi-Fi Aware communication on iOS?

Network framework. It has three different interfaces (the C interface, the original Swift interface, and the new Swift interface), all of which should work over Wi-Fi Aware.

This isn’t a hard question because Network framework is our preferred interface for TCP communications in general. BSD Sockets is supported, but it’s mainly there for compatibility. See TN3151 Choosing the right networking API.

Share and Enjoy

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

Issue with Native Socket Connection (Error 65) over WiFi Aware on iOS
 
 
Q