diff --git a/src/cpp/rtps/participant/RTPSParticipantImpl.cpp b/src/cpp/rtps/participant/RTPSParticipantImpl.cpp index 5aa11ae17fb..4d5ab5d69bc 100644 --- a/src/cpp/rtps/participant/RTPSParticipantImpl.cpp +++ b/src/cpp/rtps/participant/RTPSParticipantImpl.cpp @@ -353,10 +353,10 @@ RTPSParticipantImpl::RTPSParticipantImpl( m_att.defaultMulticastLocatorList.clear(); } - createReceiverResources(m_att.builtin.metatrafficMulticastLocatorList, true, false); - createReceiverResources(m_att.builtin.metatrafficUnicastLocatorList, true, false); - createReceiverResources(m_att.defaultUnicastLocatorList, true, false); - createReceiverResources(m_att.defaultMulticastLocatorList, true, false); + createReceiverResources(m_att.builtin.metatrafficMulticastLocatorList, true, false, true); + createReceiverResources(m_att.builtin.metatrafficUnicastLocatorList, true, false, true); + createReceiverResources(m_att.defaultUnicastLocatorList, true, false, true); + createReceiverResources(m_att.defaultMulticastLocatorList, true, false, true); namespace ExternalLocatorsProcessor = fastdds::rtps::ExternalLocatorsProcessor; ExternalLocatorsProcessor::set_listening_locators(m_att.builtin.metatraffic_external_unicast_locators, @@ -1571,7 +1571,7 @@ bool RTPSParticipantImpl::createAndAssociateReceiverswithEndpoint( } // Try creating receiver resources - if (createReceiverResources(attributes.unicastLocatorList, false, true)) + if (createReceiverResources(attributes.unicastLocatorList, false, true, false)) { break; } @@ -1600,8 +1600,8 @@ bool RTPSParticipantImpl::createAndAssociateReceiverswithEndpoint( attributes.multicastLocatorList = m_att.defaultMulticastLocatorList; attributes.external_unicast_locators = m_att.default_external_unicast_locators; } - createReceiverResources(attributes.unicastLocatorList, false, true); - createReceiverResources(attributes.multicastLocatorList, false, true); + createReceiverResources(attributes.unicastLocatorList, false, true, true); + createReceiverResources(attributes.multicastLocatorList, false, true, true); } fastdds::rtps::ExternalLocatorsProcessor::set_listening_locators(attributes.external_unicast_locators, @@ -1685,7 +1685,8 @@ void RTPSParticipantImpl::setup_external_locators( bool RTPSParticipantImpl::createReceiverResources( LocatorList_t& Locator_list, bool ApplyMutation, - bool RegisterReceiver) + bool RegisterReceiver, + bool log_when_creation_fails) { std::vector> newItemsBuffer; bool ret_val = Locator_list.empty(); @@ -1713,9 +1714,9 @@ bool RTPSParticipantImpl::createReceiverResources( } } - if (!ret) + if (!ret && log_when_creation_fails) { - EPROSIMA_LOG_ERROR(RTPS_PARTICIPANT, "Could not create the specified receiver resource"); + EPROSIMA_LOG_WARNING(RTPS_PARTICIPANT, "Could not create the specified receiver resource"); } ret_val |= !newItemsBuffer.empty(); diff --git a/src/cpp/rtps/participant/RTPSParticipantImpl.h b/src/cpp/rtps/participant/RTPSParticipantImpl.h index 2f343bc9cc8..c4f0bb88610 100644 --- a/src/cpp/rtps/participant/RTPSParticipantImpl.h +++ b/src/cpp/rtps/participant/RTPSParticipantImpl.h @@ -982,11 +982,13 @@ class RTPSParticipantImpl * @param Locator_list - Locator list to be used to create the ReceiverResources * @param ApplyMutation - True if we want to create a Resource with a "similar" locator if the one we provide is unavailable * @param RegisterReceiver - True if we want the receiver to be registered. Useful for receivers created after participant is enabled. + * @param log_when_creation_fails - True if a log warning shall be issued for each locator when a receiver resource cannot be created. */ bool createReceiverResources( LocatorList_t& Locator_list, bool ApplyMutation, - bool RegisterReceiver); + bool RegisterReceiver, + bool log_when_creation_fails); void createSenderResources( const LocatorList_t& locator_list);