@@ -217,18 +217,32 @@ static void setup_transports_udpv6(
217
217
att.userTransports .push_back (descriptor);
218
218
}
219
219
220
+ static void setup_large_data_shm_transport (
221
+ RTPSParticipantAttributes& att,
222
+ const fastdds::rtps::BuiltinTransportsOptions& options)
223
+ {
224
+ #ifdef FASTDDS_SHM_TRANSPORT_DISABLED
225
+ static_cast <void >(att);
226
+ EPROSIMA_LOG_ERROR (RTPS_PARTICIPANT, " Trying to configure Large Data transport, " <<
227
+ " but Fast DDS was built without SHM transport support. Will use " <<
228
+ " TCP for communications on the same host." );
229
+ #else
230
+ auto descriptor = create_shm_transport (att, options);
231
+ att.userTransports .push_back (descriptor);
232
+
233
+ auto shm_loc = fastdds::rtps::SHMLocator::create_locator (0 , fastdds::rtps::SHMLocator::Type::UNICAST);
234
+ att.defaultUnicastLocatorList .push_back (shm_loc);
235
+ #endif // FASTDDS_SHM_TRANSPORT_DISABLED
236
+ }
237
+
220
238
static void setup_transports_large_data (
221
239
RTPSParticipantAttributes& att,
222
240
bool intraprocess_only,
223
241
const fastdds::rtps::BuiltinTransportsOptions& options)
224
242
{
225
243
if (!intraprocess_only)
226
244
{
227
- auto shm_transport = create_shm_transport (att, options);
228
- att.userTransports .push_back (shm_transport);
229
-
230
- auto shm_loc = fastdds::rtps::SHMLocator::create_locator (0 , fastdds::rtps::SHMLocator::Type::UNICAST);
231
- att.defaultUnicastLocatorList .push_back (shm_loc);
245
+ setup_large_data_shm_transport (att, options);
232
246
233
247
auto tcp_transport = create_tcpv4_transport (att, options);
234
248
att.userTransports .push_back (tcp_transport);
@@ -261,11 +275,7 @@ static void setup_transports_large_datav6(
261
275
{
262
276
if (!intraprocess_only)
263
277
{
264
- auto shm_transport = create_shm_transport (att, options);
265
- att.userTransports .push_back (shm_transport);
266
-
267
- auto shm_loc = fastdds::rtps::SHMLocator::create_locator (0 , fastdds::rtps::SHMLocator::Type::UNICAST);
268
- att.defaultUnicastLocatorList .push_back (shm_loc);
278
+ setup_large_data_shm_transport (att, options);
269
279
270
280
auto tcp_transport = create_tcpv6_transport (att, options);
271
281
att.userTransports .push_back (tcp_transport);
0 commit comments