1

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?

jgr208
  • 2,896
  • 9
  • 36
  • 64

2 Answers2

2

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

Pete
  • 265
  • 6
  • 24
  • Thanks! I had trouble since at first using the `DomainParticipantQos` object since I didnt know to use the set default and kept running into an error. – jgr208 Oct 20 '16 at 14:08
  • 1
    you're welcome. I had the same problems when I started working with RTI's wonderful Connext DDS :-) just keep in mind that nearly all settings in Connext are altered through first retrieving, then modifying and then writing back. – Pete Oct 20 '16 at 15:32
1

The multicast_recieve_address was not set because DomainParticipantFactory.PARTICIPANT_QOS_DEFAULT is just a sentinel value whose only purpose is to indicate create_participant() to use the default QoS--which you can set with set_default_participant_qos or in XML (see also this example). You should not modify DomainParticipantFactory.PARTICIPANT_QOS_DEFAULT.

You can also create a new DomainParticipantQos object, configure it, and then pass it to create_participant(). Examples here.

alexc
  • 534
  • 2
  • 9