From 139129bd865fc6f4e1e280af33c9d4c877b0a560 Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Sat, 7 Dec 2019 09:56:33 +0100 Subject: [PATCH 1/2] Clearing locators when detecting intraprocess only config --- .../rtps/participant/RTPSParticipantImpl.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/cpp/rtps/participant/RTPSParticipantImpl.cpp b/src/cpp/rtps/participant/RTPSParticipantImpl.cpp index c9f73371aae..2c6b43edb51 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 is_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) { @@ -246,6 +256,13 @@ RTPSParticipantImpl::RTPSParticipantImpl( m_att.defaultUnicastLocatorList); } + if (is_intraprocess_only(m_att)) + { + 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); From f7394d124cb9213446d2f0b7a72704dd1e56cbec Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Tue, 10 Dec 2019 09:37:17 +0100 Subject: [PATCH 2/2] Adding is_intraprocess_only() method to RTPSParticipantImpl --- src/cpp/rtps/participant/RTPSParticipantImpl.cpp | 5 +++-- src/cpp/rtps/participant/RTPSParticipantImpl.h | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/cpp/rtps/participant/RTPSParticipantImpl.cpp b/src/cpp/rtps/participant/RTPSParticipantImpl.cpp index 2c6b43edb51..194c2ec2ec8 100644 --- a/src/cpp/rtps/participant/RTPSParticipantImpl.cpp +++ b/src/cpp/rtps/participant/RTPSParticipantImpl.cpp @@ -71,7 +71,7 @@ static EntityId_t TrustedWriter( c_EntityId_Unknown; } -static bool is_intraprocess_only( +static bool should_be_intraprocess_only( const RTPSParticipantAttributes& att) { return @@ -107,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) @@ -256,7 +257,7 @@ RTPSParticipantImpl::RTPSParticipantImpl( m_att.defaultUnicastLocatorList); } - if (is_intraprocess_only(m_att)) + if (is_intraprocess_only()) { m_att.builtin.metatrafficUnicastLocatorList.clear(); m_att.defaultUnicastLocatorList.clear(); 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. */