DomainParticipant
A DomainParticipant is the DDS Entity used by an application to join a DDS Domain. It is the first DDS Entity created by an application and serves as a factory for other DDS Entities. A DomainParticipant can join a single DDS Domain. If an application wants to join multiple DDS domains, then it must create corresponding DDS DomainParticipants, one per domain.
The DomainParticipant is responsible for discovering other DDS DomainParticipants and entities within the DDS domain. It also provides the means for an application to observe discovery information using the DDS Builtin Topics.
Typically, the first Entity that you directly create when using RTI Connext DDS is a DomainParticipant. When you create that DomainParticipant, you must specify the domain that it is active in – the DomainParticipant and all Entities that it creates will only communicate within that domain.
Once you create the DomainParticipant, you must register your data types. This allows the DomainParticipant to maintain information on how to serialize and deserialize your data types to and from a network format. After your data types are registered, you can use the DomainParticipant as a factory Entity to create Topics, Publishers, and Subscribers (the latter are then used to create DataWriters and DataReaders).
You can create multiple DomainParticipants in a single application, but if you are communicating only in one domain, you typically will create only one.
A DomainParticipant is responsible for:
- Setting up communication within a DDS domain through the discovery process.
- Deciding which transports will be used for communication. By default, a DomainParticipant will communicate over shared memory, UDPv4, and UDPv6.
- Contacting a set of initial peers to start discovery. By default, the initial peer list includes:
- Shared memory
- UDPv4 loopback: 127.0.0.1
- UDPv4 multicast: 239.255.0.1
- Maintaining a discovery database containing all remote DomainParticipants, DataWriters, and DataReaders within its domain.
- Maintaining the information on how to serialize and deserialize the data types used by its DataWriters and DataReaders.