Search code examples
javapublish-subscribemulticastqosdata-distribution-service

Multicast address in code not getting set in DDS code


I have the following code in my DDS program for java 8 using RTI DDS 5.2.0

DomainParticipantFactory.PARTICIPANT_QOS_DEFAULT.
    discovery.initial_peers.add("239.255.0.50");
DomainParticipantFactory.PARTICIPANT_QOS_DEFAULT.
    discovery.initial_peers.add("4@builtin.udpv4://127.0.0.1");
DomainParticipantFactory.PARTICIPANT_QOS_DEFAULT.
    discovery.initial_peers.add("builtin.shmem://");
DomainParticipantFactory.PARTICIPANT_QOS_DEFAULT.
    discovery.multicast_receive_addresses.clear();
DomainParticipantFactory.PARTICIPANT_QOS_DEFAULT.
    discovery.multicast_receive_addresses.add("239.255.0.50");

The setting of initial peers works correctly for the DDS code, however when I use the line to set the multicast_receive_addresses the address never gets set and keeps defaulting to the default multicast address.

Why is my multicast address not getting set?


Solution

  • try the set_default_participant_qos(DomainParticipantQos qos) method to set the modified qos as new default qos. see RTI Connext Java API