Skip to content

Commit d53fab7

Browse files
Mario-DLEduPonz
andauthored
Make explicit the need to keep alive the flow controller descriptor name (#806)
* Refs #21054: Make explicit the need for keeping alive participants flow controller descriptor name Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #21054: Missing ; Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #21054: Apply suggestions --------- Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> Co-authored-by: Eduardo Ponz Segrelles <eduardoponz@eprosima.com>
1 parent f3f4f0e commit d53fab7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

code/DDSCodeTester.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4094,8 +4094,11 @@ void dds_qos_examples()
40944094
//The PublishModeQosPolicy is default constructed with kind = SYNCHRONOUS
40954095
//Change the kind to ASYNCHRONOUS
40964096
publish_mode.kind = ASYNCHRONOUS_PUBLISH_MODE;
4097+
40974098
// Optionally, select the flow controller name
4098-
publish_mode.flow_controller_name = "example_flow_controller";
4099+
// Important: the flow_controller_name must be kept alive during the Participant's lifetime.
4100+
static std::string flow_controller_name{"example_flow_controller"};
4101+
publish_mode.flow_controller_name = flow_controller_name.c_str();
40994102
//!--
41004103
}
41014104

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

0 commit comments

Comments
 (0)