DDS_FlowControllerProperty_t Struct Reference

3 posts / 0 new
Last post
Offline
Last seen: 9 years 3 months ago
Joined: 10/28/2010
Posts: 22
DDS_FlowControllerProperty_t Struct Reference

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.

Offline
Last seen: 9 years 3 months ago
Joined: 10/28/2010
Posts: 22

 

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();

Gerardo Pardo's picture
Offline
Last seen: 3 weeks 3 days ago
Joined: 06/02/2010
Posts: 602

 

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