TCP Socket connect timeout

I have a Hardware Device (HD) what broadcast a local wifi,I used my tcp app to connect to HD and read/write data with it. The App using Cellular to update the data from HD to server.Everything work fine for a longtime.

But recently,I have a user (iPhone 7+ iOS 11.4) who getting error "Attempt to connect to host timed out" when create socket with HD.The Socket framework i using is GCDAsyncSocket.

There's a weird thing when i logged the interfaces which have "sa_family" == AF_INET, the user iphone only have lo0 & en0.
While with the other iphones (11.4) I have, the result is lo0,pdp_ip0,en0,en3.

Do anyone get same issue and how to fix it ?

There's a weird thing when i logged the interfaces which have

"sa_family" == AF_INET

This check assumes that the WWAN interface uses IPv4, which is not always the case. Many WWAN providers around the world deploy an IPv6-only network, using DNS64/NAT64 to provide access to IPv4 servers. See my Supporting IPv6-only Networks pinned post for details.

Share and Enjoy

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

let myEmail = "eskimo" + "1" + "@apple.com"
TCP Socket connect timeout
 
 
Q