My iOS application needs to connect a device by wifi and exchange data between them.
The way of transmission is using the UDP protocol, most of all, it works well. But some part of iOS devices will loss the package always. Even if re-open the application or reboot wifi devices, or reboot iOS devices, it can not be solved.
Only reset the network settings on iOS devices could fix it.
But this can not make sure that be well always, if occurs in the future. User need to reset network setting again.
Are there any brothers know or meet this phenomenon?
Thanks for your time to research this.
It’s better to reply as a reply, rather than in the comments; see Quinn’s Top Ten DevForums Tips for this and other titbits.
In my experience problems like this, where an app talking to a Wi-Fi accessory works generally but fails on a small fraction of iOS devices, are most commonly caused by the app assuming that the Wi-Fi interface is en0. We talk about this in TN3179 Understanding local network privacy, but I have a bunch of additional information related to this in the various posts linked to by Extra-ordinary Networking, including:
- Don’t Try to Get the Device’s IP Address
- Broadcasts and Multicasts, Hints and Tips
- Working with a Wi-Fi Accessory
So, I recommend that you start out by searching your codebase for en0. If you have that hard-coded somewhere in your network code, you need to fix that.
If that’s not the problem, reply back here and we can dig deeper. In that case, I’d appreciate you sharing details about the UDP protocol used by your app. Does it involve broadcasts? Or multicasts? And what does the on-the-wire traffic look like in the working case?
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"