Hi,
I would use DDS_FlowControllerProperty_t, but I ddon't how to do this.
I hope someone helps me with small example using flow control.
Thanks.
DataWriter-side:
DDS_FlowControllerProperty_t property;
property.sched_policy = DDS_EDF_FLOW_CONTROLLER_SCHED_POLICY;
property.token_bucket.max_tokens = A; //[0, DDS_LENGTH_UNLIMITED]
property.token_bucket.tokens_added_per_period = B; //[0, DDS_LENGTH_UNLIMITED]
property.token_bucket.tokens_leaked_per_period = C; //[0, DDS_LENGTH_UNLIMITED]
property.token_bucket.bytes_per_token = D; //[1024, DDS_LENGTH_UNLIMITED]
property.token_bucket.period = E; //[0, DDS_DURATION_INFINITE]
...
DDSFlowController *controller =
participant->create_flowcontroller("superflow", property);
writer_qos.publish_mode.kind = DDS_ASYNCHRONOUS_PUBLISH_MODE_QOS;
writer_qos.publish_mode.flow_controller_name = "superflow";
//
// Set up History queue size to hold deferred issues!!!!!.
writer_qos.history.kind = DDS_KEEP_LAST_HISTORY_QOS;
writer_qos.history.depth = z; // <<<<<<<<<<<<<!!!!!!!!!!!!!!<<<<<
writer->write(data_sample, ...);
... // Optional wait for pipe to empty
writer->wait_for_asynchronous_publishing(timeout);
... // Optional On-Demand trigger
controller->trigger_flow();
... // Optional Modify controller properties
controller->set_property();
There is example code on how to use the DDS FlowController in the on-line documentation.
Check the "FlowController Use Cases" in the Programming How-To's. Take a look at: http://community.rti.com/rti-doc/45f/ndds.4.5f/doc/html/api_cpp/group__DDSHowToModule.html
Gerardo
DataWriter-side:
DDS_FlowControllerProperty_t property;
property.sched_policy = DDS_EDF_FLOW_CONTROLLER_SCHED_POLICY;
property.token_bucket.max_tokens = A; //[0, DDS_LENGTH_UNLIMITED]
property.token_bucket.tokens_added_per_period = B; //[0, DDS_LENGTH_UNLIMITED]
property.token_bucket.tokens_leaked_per_period = C; //[0, DDS_LENGTH_UNLIMITED]
property.token_bucket.bytes_per_token = D; //[1024, DDS_LENGTH_UNLIMITED]
property.token_bucket.period = E; //[0, DDS_DURATION_INFINITE]
...
DDSFlowController *controller =
participant->create_flowcontroller("superflow", property);
...
writer_qos.publish_mode.kind = DDS_ASYNCHRONOUS_PUBLISH_MODE_QOS;
writer_qos.publish_mode.flow_controller_name = "superflow";
//
// Set up History queue size to hold deferred issues!!!!!.
writer_qos.history.kind = DDS_KEEP_LAST_HISTORY_QOS;
writer_qos.history.depth = z; // <<<<<<<<<<<<<!!!!!!!!!!!!!!<<<<<
...
writer->write(data_sample, ...);
... // Optional wait for pipe to empty
writer->wait_for_asynchronous_publishing(timeout);
... // Optional On-Demand trigger
controller->trigger_flow();
... // Optional Modify controller properties
controller->set_property();
Hi,
There is example code on how to use the DDS FlowController in the on-line documentation.
Check the "FlowController Use Cases" in the Programming How-To's. Take a look at: http://community.rti.com/rti-doc/45f/ndds.4.5f/doc/html/api_cpp/group__DDSHowToModule.html
Gerardo