From ee8360a0695f8b2c93a436315c858c4f59b9d66c Mon Sep 17 00:00:00 2001 From: cferreiragonz Date: Fri, 14 Jun 2024 09:12:03 +0200 Subject: [PATCH] Refs #20650: Create initial connect for initial peers Signed-off-by: cferreiragonz --- .../rtps/builtin/discovery/participant/PDPSimple.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/cpp/rtps/builtin/discovery/participant/PDPSimple.cpp b/src/cpp/rtps/builtin/discovery/participant/PDPSimple.cpp index 99cec6078ab..cdf1e6fcfc0 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDPSimple.cpp +++ b/src/cpp/rtps/builtin/discovery/participant/PDPSimple.cpp @@ -379,7 +379,17 @@ bool PDPSimple::create_dcps_participant_endpoints() WriterAttributes watt = create_builtin_writer_attributes(); watt.endpoint.reliabilityKind = BEST_EFFORT; - watt.endpoint.remoteLocatorList = m_discovery.initialPeersList; + if (!m_discovery.initialPeersList.empty()) + { + if (mp_RTPSParticipant->has_tcp_transports()) + { + mp_RTPSParticipant->create_tcp_connections(m_discovery.initialPeersList); + } + else + { + watt.endpoint.remoteLocatorList = m_discovery.initialPeersList; + } + } if (pattr.throughputController.bytesPerPeriod != UINT32_MAX && pattr.throughputController.periodMillisecs != 0) {