How do I run multiple publisher or subscriber applications on the same machine with the same domain ID?

Note: Applies to RTI Data Distribution Service 4.0 and 4.1.

RTI Data Distribution Service selects well-known static ports based on this formula:

7400 + A * (DomainID + (B * Participant_index)) + (0 | 1 | 2)

Where A and B are user-definable, with defaults of 10 and 100, respectively. 

To run multiple applications in the same domain, make sure that each application (DomainParticipant) has a unique participant index; this will ensure the applications use different ports. (The participant index is set in the DomainParticipant's Discovery QoS policy.) 

By default, RTI Data Distribution Service 4.1x automatically determines the participant index for each application. This is done by trial-and-error starting with index 0. 

A common reason for manually assigning the index is to explicitly control what ports an application uses for security and firewall network configuration. (See the documentation on the Discovery QoS Policy for more information.)