Skip to content

Commit

Permalink
Refs #21170: Support DS servers connection
Browse files Browse the repository at this point in the history
Signed-off-by: cferreiragonz <[email protected]>
  • Loading branch information
cferreiragonz committed Jun 12, 2024
1 parent 816e9a9 commit f231133
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/cpp/rtps/builtin/discovery/participant/PDPServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,16 +485,6 @@ bool PDPServer::create_ds_pdp_reliable_endpoints(
wout->reader_data_filter(pdp_filter);
// Enable separate sending so the filter can be called for each change and reader proxy
wout->set_separate_sending(true);

if (!secure)
{
eprosima::shared_lock<eprosima::shared_mutex> disc_lock(mp_builtin->getDiscoveryMutex());

for (const eprosima::fastdds::rtps::RemoteServerAttributes& it : mp_builtin->m_DiscoveryServers)
{
match_pdp_reader_nts_(it);
}
}
}
// Could not create PDP Writer, so return false
else
Expand Down
15 changes: 15 additions & 0 deletions src/cpp/rtps/participant/RTPSParticipantImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,21 @@ RTPSParticipantImpl::RTPSParticipantImpl(
}
});
}
for (fastdds::rtps::RemoteServerAttributes& it : m_att.builtin.discovery_config.m_DiscoveryServers)
{
std::for_each(it.metatrafficUnicastLocatorList.begin(),
it.metatrafficUnicastLocatorList.end(), [&](Locator_t& locator)
{
// TCP DS default logical port is the same as the physical one
if (locator.kind == LOCATOR_KIND_TCPv4 || locator.kind == LOCATOR_KIND_TCPv6)
{
if (IPLocator::getLogicalPort(locator) == 0)
{
IPLocator::setLogicalPort(locator, IPLocator::getPhysicalPort(locator));
}
}
});
}
}
}
break;
Expand Down

0 comments on commit f231133

Please sign in to comment.