RTI Connext Traditional C++ API  Version 6.0.0
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Participant Use Cases

Working with domain participants. More...

Working with domain participants.

Turning off auto-enable of newly created participant(s)

Getting the factory

Setting up a participant

DDS_DomainParticipantQos participant_qos;
DDSDomainParticipantListener* participant_listener = NULL;
// Set the initial peers. This list includes all the computers the
// application may communicate with, along with the maximum number of
// RTI Data Distribution Service participants that can concurrently
// run on that computer. This list only needs to be a superset of the
// actual list of computers and participants that will be running at
// any time.
const char* NDDS_DISCOVERY_INITIAL_PEERS[] = {
"host1",
"10.10.30.192",
"1@localhost",
"2@host2",
"my://", /* all unicast addrs on transport plugins with alias "my" */
"2@shmem://", /* shared memory */
"FF00:ABCD::0",
"sf://0/0/R", /* StarFabric transport plugin */
"1@FF00:0:1234::0",
"225.1.2.3",
"3@225.1.0.55",
"FAA0::0#0/0/R",
};
const DDS_Long NDDS_DISCOVERY_INITIAL_PEERS_LENGTH =
sizeof(NDDS_DISCOVERY_INITIAL_PEERS)/sizeof(const char*);
// initialize participant_qos with default values
retcode = factory->get_default_participant_qos(participant_qos);
if (retcode != DDS_RETCODE_OK) {
printf("***Error: failed to get default participant qos\n");
}
if (!participant_qos.discovery.initial_peers.from_array(
NDDS_DISCOVERY_INITIAL_PEERS,
NDDS_DISCOVERY_INITIAL_PEERS_LENGTH)) {
printf("***Error: failed to set discovery.initial_peers qos\n");
}
// Create the participant
DDSDomainParticipant* participant =
factory->create_participant(domain_id,
participant_qos,
participant_listener,
if (participant == NULL) {
printf("***Error: failed to create domain participant\n");
};
return participant;

Tearing down a participant


RTI Connext Traditional C++ API Version 6.0.0 Copyright © Sun Mar 3 2019 Real-Time Innovations, Inc