Skip to content

Commit

Permalink
Refs #12522: Client reconnection fix
Browse files Browse the repository at this point in the history
Signed-off-by: jparisu <javierparis@eprosima.com>
  • Loading branch information
jparisu committed Oct 28, 2021
1 parent b4dfc3e commit c779aee
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/cpp/rtps/builtin/discovery/participant/PDPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,32 @@ bool get_server_client_default_guidPrefix(
return false;
}

bool PDPClient::remove_remote_participant(
const GUID_t& partGUID,
ParticipantDiscoveryInfo::DISCOVERY_STATUS reason)
{
if(PDP::remove_remote_participant(partGUID, reason))
{
// If it works fine, return
return true;
}

// Erase Proxies created before having the Participant
GUID_t wguid;
wguid.guidPrefix = partGUID.guidPrefix;
wguid.entityId = c_EntityId_SPDPWriter;
mp_PDPReader->matched_writer_remove(wguid);

GUID_t rguid;
rguid.guidPrefix = partGUID.guidPrefix;
rguid.entityId = c_EntityId_SPDPReader;
mp_PDPWriter->matched_reader_remove(rguid);

update_remote_servers_list();

return false;
}

} /* namespace rtps */
} /* namespace fastdds */
} /* namespace eprosima */
10 changes: 10 additions & 0 deletions src/cpp/rtps/builtin/discovery/participant/PDPClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,16 @@ class PDPClient : public PDP
void notifyAboveRemoteEndpoints(
const ParticipantProxyData& pdata) override;

/**
* This method removes a remote RTPSParticipant and all its writers and readers.
* @param participant_guid GUID_t of the remote RTPSParticipant.
* @param reason Why the participant is being removed (dropped vs removed)
* @return true if correct.
*/
bool remove_remote_participant(
const GUID_t& participant_guid,
ParticipantDiscoveryInfo::DISCOVERY_STATUS reason) override;

/**
* Matching server EDP endpoints
* @return true if all servers have been discovered
Expand Down

0 comments on commit c779aee

Please sign in to comment.