iOS18 UDP failed to send data

iOS18 UDP fails to send data, iOS other systems fine

  1. Device discovery by broadcasting over UDP
  2. Failed to send data to the discovered device using UDP communication
  3. This problem only occurs on iOS18, other iOS versions work fine

I read the official forum of Apple, it is recommended to use BSD socket to send data, and it cannot be sent on iOS18. I suspect that the device privacy permission is found locally, which is invalid on iOS18

This problem is serious for us at present Hope to receive it ASAP. Your Recovery

iOS 18 has not introduced any new rules with regards sending and receiving UDP. My experience is that a lot of UDP code is brittle, meaning that it can break on major OS release or on specific devices.

The underlying reason for that is that a of UDP code is based on BSD Sockets, and BSD Sockets is a hard API to use correctly. Normally I’d suggest a switch to Network framework, but in this case that’s not viable because your implementing a service discovery protocol using UDP broadcasts.

My general advice on that front is that you stop doing that, and instead adopt Bonjour [1]. However, I recognise that this isn’t feasible if you’re working with someone else’s accessory (OTOH, if you do control the accessory firmware then you should definitely lean on the firmware folks to just do this already).

As to how you fix things right now, I have a bunch of advice in this space in my Extra-ordinary Networking post. Specifically, follow the link to Don’t Try to Get the Device’s IP Address and look in the Service Discovery section.

Share and Enjoy

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

[1] Bonjour is an Apple term for three industry-standard protocols:

My application also crashes when attempting to communicate via UDP.

iOS18 UDP failed to send data
 
 
Q