iOS 16.0 Beta: UDP broadcast not working with "No route to host" error.

After updating my iphone to iOS 16.0 Beta, I am not able to broadcast UDP (using broadcasting IP 226.120.89.84) message on my local network and getting the error message: "No route to host"

premise:

1、entitlements.plist in .ipa, multicast has been granted com.apple.developer.networking.multicast 2、Already grant the app access to your local network 3、iOS 15.5、iOS 15.6.1 is working

Here is my code: res = sendto(socket_info->sock_fd, buffer, 1, 0, (sockaddr *)&multicast_addr, addr_len);

When I run on an iPhone with iOS 16.0 Beta installed, I get the following error:

The"sendto" function return -1 errno = 65 - no route to host

Any help is appreciated. Thanks in advance.

When sending a multicast my advice is that you bind to a specific interface. Otherwise you end up relying on the system to choose an interface for you, and that’s a complicated process.

On Apple platforms the easiest way to set this up is with the IP_MULTICAST_IFINDEX socket option.

The same logic applies for broadcasts, although in that case you use IP_BOUND_IF.

Share and Enjoy

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

I have encountered the same problem here. Have you found a solution later?

iOS 16.0 Beta: UDP broadcast not working with "No route to host" error.
 
 
Q