iOS 16 UDP Broadcast

My app uses UDP broadcast to find out a peer on a private network (169.254..). With iOS 14 and iOS 15 everything works fine, but on the newly released iOS 16 release candidate I get a 'Socket Error 65: No Route To Host'.

I don't have any special entitlements for this app. Did anything change with regards to UDP broadcast policies from iOS 15 to iOS 16?

Accepted Reply

I still don't understand why this moved from optional to mandatory just now

We started enforced this for BSD Sockets code in iOS 14.5 (see FAQ-3). I remember verifying that myself personally at the time. However, some time during the iOS 15 cycle that patch came unstuck. This is annoying because it mislead folks, like yourself, into thinking that this wasn’t a requirement. We glued the patch back down again during the iOS 16 development cycle, and that’s how we got to where we’re currently at.

Share and Enjoy

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

Replies

Presumably you’re using BSD Sockets for this. If so, problems like this are quite common because it’s surprisingly easy to write incorrect broadcast code. But first, let’s start with a clarification:

I don't have any special entitlements for this app.

Other than the local network privacy multicast entitlement one, right? See Local Network Privacy FAQ.

Share and Enjoy

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

Unfortunately I'm not in possession of that multicast entitlement. In fact, until yesterday I did not know that it existed in the first place. I have now requested it and hope that I will receive it very soon (can I do anything to speed up this process? Some of my clients have requested it for their apps as well yesterday).

Assuming this is the culprit, I still don't understand why this moved from optional to mandatory ­just now – the notes seem to talk about iOS14 and yet this policy seems to have been only implemented as of iOS16.

I still don't understand why this moved from optional to mandatory just now

We started enforced this for BSD Sockets code in iOS 14.5 (see FAQ-3). I remember verifying that myself personally at the time. However, some time during the iOS 15 cycle that patch came unstuck. This is annoying because it mislead folks, like yourself, into thinking that this wasn’t a requirement. We glued the patch back down again during the iOS 16 development cycle, and that’s how we got to where we’re currently at.

Share and Enjoy

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

I am having the same exact issue, and the UDP broadcast does work from simulator, it does not work on device updated to IOS 16, any help would be appreciated, the entitlement thing does not seem to make any sense since it has been there since 14 and never cause an issue.

  • You do have the entitlement? If so, it should still work on iOS 16. The simulator uses the macOS network infrastructure which ­– thankfully ­– does not implement that (censored) broadcast restriction, so it's not surprising that it works there.

Add a Comment

I come cross this also with 255.255.255.255 boardcast.... Any way to solve?

  • Only by requesting (and then code signing) with the said entitlement. I'm waiting for mine since 5 days now.

Add a Comment

I had the same problem with iOS 16.1 (Entitlement "com.apple.developer.networking.multicast" not working at all on device with "no route to host" error) I updated to iOS 16.2 and all suddenly worked.