diff --git a/rmw_fastrtps_shared_cpp/src/participant.cpp b/rmw_fastrtps_shared_cpp/src/participant.cpp index f365e39a5..9acb2fcbb 100644 --- a/rmw_fastrtps_shared_cpp/src/participant.cpp +++ b/rmw_fastrtps_shared_cpp/src/participant.cpp @@ -15,6 +15,7 @@ #include #include +#include #include "fastrtps/config.h" #include "fastrtps/Domain.h" @@ -165,7 +166,7 @@ rmw_fastrtps_shared_cpp::create_participant( if (localhost_only) { // In order to use the interface white list, we need to disable the default transport config participantAttrs.rtps.useBuiltinTransports = false; - + // Add a UDPv4 transport with only localhost enabled auto udp_transport = std::make_shared(); udp_transport->interfaceWhiteList.emplace_back("127.0.0.1"); @@ -176,7 +177,6 @@ rmw_fastrtps_shared_cpp::create_participant( auto shm_transport = std::make_shared(); participantAttrs.rtps.userTransports.push_back(shm_transport); #endif - } // No custom handling of RMW_DEFAULT_DOMAIN_ID. Simply use a reasonable domain id.