diff --git a/src/cpp/rtps/participant/RTPSParticipantImpl.cpp b/src/cpp/rtps/participant/RTPSParticipantImpl.cpp index c9f73371aae..194c2ec2ec8 100644 --- a/src/cpp/rtps/participant/RTPSParticipantImpl.cpp +++ b/src/cpp/rtps/participant/RTPSParticipantImpl.cpp @@ -54,6 +54,7 @@ #include #include +#include namespace eprosima { namespace fastrtps { @@ -70,6 +71,15 @@ static EntityId_t TrustedWriter( c_EntityId_Unknown; } +static bool should_be_intraprocess_only( + const RTPSParticipantAttributes& att) +{ + return + xmlparser::XMLProfileManager::library_settings().intraprocess_delivery == INTRAPROCESS_FULL && + att.builtin.discovery_config.ignoreParticipantFlags == + (ParticipantFilteringFlags::FILTER_DIFFERENT_HOST | ParticipantFilteringFlags::FILTER_DIFFERENT_PROCESS); +} + Locator_t& RTPSParticipantImpl::applyLocatorAdaptRule( Locator_t& loc) { @@ -97,6 +107,7 @@ RTPSParticipantImpl::RTPSParticipantImpl( , mp_participantListener(plisten) , mp_userParticipant(par) , mp_mutex(new std::recursive_mutex()) + , is_intraprocess_only_(should_be_intraprocess_only(PParam)) { // Builtin transport by default if (PParam.useBuiltinTransports) @@ -246,6 +257,13 @@ RTPSParticipantImpl::RTPSParticipantImpl( m_att.defaultUnicastLocatorList); } + if (is_intraprocess_only()) + { + m_att.builtin.metatrafficUnicastLocatorList.clear(); + m_att.defaultUnicastLocatorList.clear(); + m_att.defaultMulticastLocatorList.clear(); + } + createReceiverResources(m_att.builtin.metatrafficMulticastLocatorList, true, false); createReceiverResources(m_att.builtin.metatrafficUnicastLocatorList, true, false); diff --git a/src/cpp/rtps/participant/RTPSParticipantImpl.h b/src/cpp/rtps/participant/RTPSParticipantImpl.h index 1631dab5956..d36ad4a84cf 100644 --- a/src/cpp/rtps/participant/RTPSParticipantImpl.h +++ b/src/cpp/rtps/participant/RTPSParticipantImpl.h @@ -281,6 +281,11 @@ class RTPSParticipantImpl WLP* wlp(); + bool is_intraprocess_only() const + { + return is_intraprocess_only_; + } + bool get_remote_writer_info(const GUID_t& writerGuid, WriterProxyData& returnedInfo); bool get_remote_reader_info(const GUID_t& readerGuid, ReaderProxyData& returnedInfo); @@ -420,6 +425,9 @@ class RTPSParticipantImpl //!Participant Mutex std::recursive_mutex* mp_mutex; + //!Will this participant use intraprocess only? + bool is_intraprocess_only_; + /* * Flow controllers for this participant. */