Skip to content

Commit

Permalink
Check if SHM transport is disabled in LARGE_DATA modes (#5355)
Browse files Browse the repository at this point in the history
* Refs #21959: Check for SHM_DISABLE in large_data setup modes

Signed-off-by: Mario-DL <mariodominguez@eprosima.com>

* Refs #21959: Apply Miguels rev

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

* Refs #21959: Apply suggestion

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>

---------

Signed-off-by: Mario-DL <mariodominguez@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
(cherry picked from commit a7dfdf5)

# Conflicts:
#	src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp
  • Loading branch information
Mario-DL authored and MiguelCompany committed Nov 4, 2024
1 parent d1b63eb commit 28dc5f5
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,39 @@ 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. Will use " <<
"TCP for communications on the same host.");
#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)
{
if (!intraprocess_only)
{
<<<<<<< HEAD
auto shm_transport = create_shm_transport(att);
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);
>>>>>>> a7dfdf5b4 (Check if `SHM` transport is disabled in `LARGE_DATA` modes (#5355))

auto tcp_transport = create_tcpv4_transport(att);
att.userTransports.push_back(tcp_transport);
Expand Down Expand Up @@ -229,11 +251,15 @@ static void setup_transports_large_datav6(
{
if (!intraprocess_only)
{
<<<<<<< HEAD
auto shm_transport = create_shm_transport(att);
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);
>>>>>>> a7dfdf5b4 (Check if `SHM` transport is disabled in `LARGE_DATA` modes (#5355))

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

0 comments on commit 28dc5f5

Please sign in to comment.