Hi @DTS Engineer,
QUOTE (link) Our general advice is to prefer Network framework over BSD Sockets, but UDP broadcasts and multicasts are an exception to that rule. Network framework has very limited UDP broadcast support. And while it’s support for UDP multicasts is less limited, it’s still not sufficient for all UDP applications. In cases where Network framework is not sufficient, BSD Sockets is your only option. UNQUOTE
The idea is to know if Network framework is sufficient for us or should we be using BSD sockets API for multicast? Our use case is not very fancy and want to receive and send multicast on all interfaces.
The code which we have written above is very simple and works for a IPv4 multicast group address but gives warnings and errors as listed above for IPv6 multicast group address. So, we wanted to know if 'Network Framework' has limited support for IPv6 multicast or it is a bug?
Some of the limitations which are already known to us and we might soon file bugs for them as suggested by you in the past (consolidating and sharing them here to validate with you):
Unlike BSD sockets, where a single socket can be used to join multiple multicast groups—including both IPv4 and IPv6 groups when using a dual-stack (v4/v6) socket—the Network framework requires creating a separate NWConnectionGroup for each NWMulticastGroup you want to listen to.
When attempting to create two UDP NWListener instances on the same port with allowLocalEndpointReuse set to true (either within the same process or across different processes on the same device), the second listener fails to start with the error: POSIXErrorCode(rawValue: 48): Address already in use. Our expectation was that both listeners would be able to coexist without issues, given that allowLocalEndpointReuse was enabled. If this behavior is not intended to work, we’d appreciate it if the documentation for allowLocalEndpointReuse could be clarified accordingly. The developer forum thread where we have, had a discussion with a DTS engineer on this is here. If it is a bug, we will file a bug and share the bug number on the developer forum thread.
In the absence of an interface constraint (without setting requiredInterface), we are not able to send and receive multicast traffic on all interfaces. Also if we apply an interface constraint (via requiredInterface), we are not able to force the group to use a specific interface. In both cases, it only uses the primary active interface to send and receive multicast. If that is not expected to work, can we get the documentation updated for requiredInterface. The developer forum thread where we have, had a discussion with a DTS engineer on this is Link1 /Link2. If it is a bug, we will file a bug and share the bug number on the developer forum thread.