diff --git a/src/cpp/rtps/builtin/discovery/participant/PDPSimple.cpp b/src/cpp/rtps/builtin/discovery/participant/PDPSimple.cpp index 18c1489cec..617704c730 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDPSimple.cpp +++ b/src/cpp/rtps/builtin/discovery/participant/PDPSimple.cpp @@ -569,8 +569,13 @@ void PDPSimple::removeRemoteEndpoints( ParticipantProxyData* pdata) { EPROSIMA_LOG_INFO(RTPS_PDP, "For RTPSParticipant: " << pdata->m_guid); + unmatch_pdp_remote_endpoints(pdata->m_guid); +} - GUID_t guid = pdata->m_guid; +void PDPSimple::unmatch_pdp_remote_endpoints( + const GUID_t& participant_guid) +{ + GUID_t guid = participant_guid; { auto endpoints = dynamic_cast(builtin_endpoints_.get()); @@ -602,6 +607,7 @@ void PDPSimple::notifyAboveRemoteEndpoints( { if (notify_secure_endpoints) { + unmatch_pdp_remote_endpoints(pdata.m_guid); match_pdp_remote_endpoints(pdata, true, false); } else diff --git a/src/cpp/rtps/builtin/discovery/participant/PDPSimple.h b/src/cpp/rtps/builtin/discovery/participant/PDPSimple.h index 0631a9e645..ff7b785d5d 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDPSimple.h +++ b/src/cpp/rtps/builtin/discovery/participant/PDPSimple.h @@ -146,6 +146,14 @@ class PDPSimple : public PDP bool notify_secure_endpoints, bool writer_only); + /** + * @brief Unmatch PDP endpoints with a remote participant. + * + * @param participant_guid GUID of the remote participant. + */ + void unmatch_pdp_remote_endpoints( + const GUID_t& participant_guid); + void assign_low_level_remote_endpoints( const ParticipantProxyData& pdata, bool notify_secure_endpoints);