13.1.1. Configuring Initial PeersΒΆ

A complete description of the initial peers list and its configuration can be found in Initial peers. For convenience, this example shows how to configure an initial peers list with one peer on host with participant ID 1 in domain 0.


Note that the port number used here is not arbitrary, as discovery ports are defined by the RTPS v2.2 standard. Refer to Well Known Ports to learn about these standard port numbers.


DomainParticipantQos qos;

// configure an initial peer on host
// The port number corresponds to the well-known port for metatraffic unicast
// on participant ID `1` and domain `0`.
Locator_t initial_peer;
IPLocator::setIPv4(initial_peer, "");
initial_peer.port = 7412;


<?xml version="1.0" encoding="UTF-8" ?>
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
    <participant profile_name="initial_peers_example_profile" is_default_profile="true">