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: