Using IP address resolved from NetService over peer-to-peer WiFi

Hi,

My requirement is similar to the following post,

https://forums.developer.apple.com/thread/76998

Basically, I have retrieved IP address ("fe..::1c_2:a.f:fe..b:1ab1%awdl0") from NetService and I need to use the IP address for creating custom client / server communication over peer-to-peer WiFi. I tried tcp connection and which is getting timed out. Please share details on feasibility and links.


Thank you.

Replies

My recommendation is that you not extract the IP address but instead get the

hostName
property and pass that to a connect-by-name API.

Also, keep in mind that if you want to listen for incoming connection over peer-to-peer Wi-Fi you must use

NSNetService
for your listener (via
NSNetServiceListenForConnections
). If you listen with BSD Sockets it just won’t work.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi Eskimo, Thank you for the details. I will follow your recommendations.