What causes this error: "NDDS_Transport_UDPv4_SocketFactory_create_receive_socket: No interface found enabled for multicast"

Note: Applies to RTI Connext DDS 4.4 and above

The following error:

NDDS_Transport_UDPv4_SocketFactory_create_receive_socket: No interface found enabled for multicast.

happens when a DomainParticipant is created with UDPv4 transport enabled (which is the default value) and all network interfaces are disabled. In this scenario, RTI Connext DDS attempts to communicate using multicast over UDPv4, throwing the above error. Therefore, if you need to run a DDS application and no network interface is enabled, you need to prevent the DomainParticipant from using multicast discovery.

The easiest solution to this error is to disable UDPv4 and select Shared Memory transport. Note that by default, the built-in transports mask is set to SHMEM | UDPv4, so you need to add the following QoS configuration to modify it:

<participant_qos>
              ...
   <transport_builtin>
       <mask>SHMEM</mask> 
   </transport_builtin>  
              ... 
</participant_qos>

The above solution, however, disables UDPv4 completely. So you could only discover DDS applications within the same computer. A more general approach is to null out multicast receive addresses and to remove multicast addresses from the list of initial peers as shown below.

<participant_qos> 
              ...
   <discovery>
      <initial_peers>
         <element>builtin.shmem://</element>
         <element>127.0.0.1</element>
         <!-- list of unicast IP endpoints -->
         <element>192.168.0.6</element>
         <element>192.168.0.7</element>
      </initial_peers>
      <!-- Note multicast receive address is nulled out -->
      <multicast_receive_addresses/>
   </discovery>
              ... 
</participant_qos>