Skip to content

[21959] Check if SHM transport is disabled in LARGE_DATA modes #5355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,18 +217,31 @@ static void setup_transports_udpv6(
att.userTransports.push_back(descriptor);
}

static void setup_large_data_shm_transport(
RTPSParticipantAttributes& att,
const fastdds::rtps::BuiltinTransportsOptions& options)
{
#ifdef FASTDDS_SHM_TRANSPORT_DISABLED
static_cast<void>(att);
EPROSIMA_LOG_ERROR(RTPS_PARTICIPANT, "Trying to configure Large Data transport, " <<
"but Fast DDS was built without SHM transport support.");
#else
auto descriptor = create_shm_transport(att, options);
att.userTransports.push_back(descriptor);

auto shm_loc = fastdds::rtps::SHMLocator::create_locator(0, fastdds::rtps::SHMLocator::Type::UNICAST);
att.defaultUnicastLocatorList.push_back(shm_loc);
#endif // FASTDDS_SHM_TRANSPORT_DISABLED
}

static void setup_transports_large_data(
RTPSParticipantAttributes& att,
bool intraprocess_only,
const fastdds::rtps::BuiltinTransportsOptions& options)
{
if (!intraprocess_only)
{
auto shm_transport = create_shm_transport(att, options);
att.userTransports.push_back(shm_transport);

auto shm_loc = fastdds::rtps::SHMLocator::create_locator(0, fastdds::rtps::SHMLocator::Type::UNICAST);
att.defaultUnicastLocatorList.push_back(shm_loc);
setup_large_data_shm_transport(att, options);

auto tcp_transport = create_tcpv4_transport(att, options);
att.userTransports.push_back(tcp_transport);
Expand Down Expand Up @@ -261,11 +274,7 @@ static void setup_transports_large_datav6(
{
if (!intraprocess_only)
{
auto shm_transport = create_shm_transport(att, options);
att.userTransports.push_back(shm_transport);

auto shm_loc = fastdds::rtps::SHMLocator::create_locator(0, fastdds::rtps::SHMLocator::Type::UNICAST);
att.defaultUnicastLocatorList.push_back(shm_loc);
setup_large_data_shm_transport(att, options);

auto tcp_transport = create_tcpv6_transport(att, options);
att.userTransports.push_back(tcp_transport);
Expand Down
Loading