Skip to content

Commit

Permalink
Make explicit the need to keep alive the flow controller descriptor n…
Browse files Browse the repository at this point in the history
…ame (#806)

* Refs #21054: Make explicit the need for keeping alive participants flow controller descriptor name

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #21054: Missing ;

Signed-off-by: Mario Dominguez <[email protected]>

* Refs #21054: Apply suggestions

---------

Signed-off-by: Mario Dominguez <[email protected]>
Co-authored-by: Eduardo Ponz Segrelles <[email protected]>
  • Loading branch information
Mario-DL and EduPonz authored Jun 8, 2024
1 parent f3f4f0e commit d53fab7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion code/DDSCodeTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4094,8 +4094,11 @@ void dds_qos_examples()
//The PublishModeQosPolicy is default constructed with kind = SYNCHRONOUS
//Change the kind to ASYNCHRONOUS
publish_mode.kind = ASYNCHRONOUS_PUBLISH_MODE;

// Optionally, select the flow controller name
publish_mode.flow_controller_name = "example_flow_controller";
// Important: the flow_controller_name must be kept alive during the Participant's lifetime.
static std::string flow_controller_name{"example_flow_controller"};
publish_mode.flow_controller_name = flow_controller_name.c_str();
//!--
}

Expand Down Expand Up @@ -5409,6 +5412,7 @@ void dds_usecase_examples()
{
//CONF-QOS-FLOWCONTROLLER
// Limit to 300kb per second.
// Important: the flow_controller_name must be kept alive during the Participant's lifetime.
static const char* flow_controller_name = "example_flow_controller";
auto flow_control_300k_per_sec = std::make_shared<eprosima::fastdds::rtps::FlowControllerDescriptor>();
flow_control_300k_per_sec->name = flow_controller_name;
Expand Down

0 comments on commit d53fab7

Please sign in to comment.