Skip to content

Commit

Permalink
Allow custom transports on init_monitor. (#160)
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Company <[email protected]>
  • Loading branch information
MiguelCompany authored Jul 5, 2022
1 parent 143f007 commit 52cd0f1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/cpp/StatisticsBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,14 @@ EntityId StatisticsBackend::init_monitor(
/* Previous string conversion is needed for string_255 */
std::string participant_name = "monitor_domain_" + std::to_string(domain_id);
participant_qos.name(participant_name);
/* Avoid using SHM transport by default */
std::shared_ptr<eprosima::fastdds::rtps::UDPv4TransportDescriptor> udp_transport =
std::make_shared<eprosima::fastdds::rtps::UDPv4TransportDescriptor>();
participant_qos.transport().user_transports.push_back(udp_transport);
participant_qos.transport().use_builtin_transports = false;
if (participant_qos.transport().use_builtin_transports)
{
/* Avoid using SHM transport by default */
std::shared_ptr<eprosima::fastdds::rtps::UDPv4TransportDescriptor> udp_transport =
std::make_shared<eprosima::fastdds::rtps::UDPv4TransportDescriptor>();
participant_qos.transport().user_transports.push_back(udp_transport);
participant_qos.transport().use_builtin_transports = false;
}

return create_and_register_monitor(domain_name.str(), domain_listener, callback_mask, data_mask, participant_qos,
domain_id);
Expand Down

0 comments on commit 52cd0f1

Please sign in to comment.