socket connect error 65

Dear apple: Our app uses the BSD socket interface for socket communication over the local area network. However, when using the socket's connect interface, some iPhone devices fail, and the socket has also bound the local Wi-Fi card's IP using the bind interface. The errno is 65, indicating "no route." We have checked that the app has already requested local network permissions and permissions to use the local area network. The TCP server on the other end is also listening normally. Please help us see if any additional permissions need to be requested. Thank you

Answered by DTS Engineer in 851679022

First up, some general advice. When you start a thread on the forums, it’s really important to choose your topic, subtopic, and tags wisely. I didn’t notice this thread originally you put it in Community > Apple Developers with no tags, so there was no indication that it was about networking. I only stumbled across it today because I was looking at the context of your other thread.

Anyway, I’ve fixed the tags now, so we’re all good here. But please keep this in mind for the future.

Oh, and for other hits and tips about using the forums effectively, see Quinn’s Top Ten DevForums Tips.

And now, back to your real question…


the socket has also bound the local Wi-Fi card's IP using the bind interface.

There are two common problems here, and they’re somewhat related:

  • Local network privacy
  • Determining the Wi-Fi interface

For all about local network privacy, see TN3179 Understanding local network privacy.

IMPORTANT iOS 18 has a critical local network privacy bug, one that we fixed in iOS 18.6. So, if you hit problems on iOS 18, make sure that you’re testing on iOS 18.6 or later.

On the Wi-Fi interface front, a lot of developers assume that en0 is the Wi-Fi interface, and that’s not guaranteed. I touch on this in TN3179, but I talk about it great detail in the various posts referenced by Extra-ordinary Networking.

Share and Enjoy

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

Dear Apple: Can you help me?

First up, some general advice. When you start a thread on the forums, it’s really important to choose your topic, subtopic, and tags wisely. I didn’t notice this thread originally you put it in Community > Apple Developers with no tags, so there was no indication that it was about networking. I only stumbled across it today because I was looking at the context of your other thread.

Anyway, I’ve fixed the tags now, so we’re all good here. But please keep this in mind for the future.

Oh, and for other hits and tips about using the forums effectively, see Quinn’s Top Ten DevForums Tips.

And now, back to your real question…


the socket has also bound the local Wi-Fi card's IP using the bind interface.

There are two common problems here, and they’re somewhat related:

  • Local network privacy
  • Determining the Wi-Fi interface

For all about local network privacy, see TN3179 Understanding local network privacy.

IMPORTANT iOS 18 has a critical local network privacy bug, one that we fixed in iOS 18.6. So, if you hit problems on iOS 18, make sure that you’re testing on iOS 18.6 or later.

On the Wi-Fi interface front, a lot of developers assume that en0 is the Wi-Fi interface, and that’s not guaranteed. I touch on this in TN3179, but I talk about it great detail in the various posts referenced by Extra-ordinary Networking.

Share and Enjoy

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

socket connect error 65
 
 
Q