jgr208
jgr208

Reputation: 3066

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("[email protected]://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?

Upvotes: 1

Views: 420

Answers (2)

alexc
alexc

Reputation: 534

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.

Upvotes: 1

Pete
Pete

Reputation: 343

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

Upvotes: 2

Related Questions