DDS::PublishModeQosPolicy Class Reference
[PUBLISH_MODE]

Specifies how RTI Data Distribution Service sends application data on the network. This QoS policy can be used to tell RTI Data Distribution Service to use its own thread to send data, instead of the user thread. More...

#include <managed_infrastructure.h>

List of all members.

Static Public Member Functions

static System::String^ get_publishmode_qos_policy_name ()
 Stringified human-readable name for DDS::PublishModeQosPolicy.

Public Attributes

PublishModeQosPolicyKind kind
 Publishing mode.
System::String^ flow_controller_name
 Name of the associated flow controller.


Detailed Description

Specifies how RTI Data Distribution Service sends application data on the network. This QoS policy can be used to tell RTI Data Distribution Service to use its own thread to send data, instead of the user thread.

The publishing mode of a DDS::DataWriter determines whether data is written synchronously in the context of the user thread when calling DDS::TypedDataWriter::write or asynchronously in the context of a separate thread internal to the middleware.

Each DDS::Publisher spawns a single asynchronous publishing thread (DDS::AsynchronousPublisherQosPolicy::thread) to serve all its asynchronous DDS::DataWriter instances.

See also:
DDS::AsynchronousPublisherQosPolicy

DDS::HistoryQosPolicy

DDS::FlowController

Entity:
DDS::DataWriter
Properties:
RxO = N/A
Changeable = NO

Usage

The fastest way for RTI Data Distribution Service to send data is for the user thread to execute the middleware code that actually sends the data itself. However, there are times when user applications may need or want an internal middleware thread to send the data instead. For instance, to send large data reliably, you must use an asynchronous thread.

When data is written asynchronously, a DDS::FlowController, identified by flow_controller_name, can be used to shape the network traffic. Shaping a data flow usually means limiting the maximum data rates at which the middleware will send data for a DDS::DataWriter. The flow controller will buffer any excess data and only send it when the send rate drops below the maximum rate. The flow controller's properties determine when the asynchronous publishing thread is allowed to send data and how much.

Asynchronous publishing may increase latency, but offers the following advantages:

- The DDS::TypedDataWriter::write call does not make any network calls and is therefore faster and more deterministic. This becomes important when the user thread is executing time-critical code.

- When data is written in bursts or when sending large data types as multiple fragments, a flow controller can throttle the send rate of the asynchronous publishing thread to avoid flooding the network.

- Asynchronously written samples for the same destination will be coalesced into a single network packet which reduces bandwidth consumption.

The maximum number of samples that will be coalesced depends on DDS::Transport_Property_t::gather_send_buffer_count_max (each sample requires at least 2-4 gather-send buffers). Performance can be improved by increasing DDS::Transport_Property_t::gather_send_buffer_count_max. Note that the maximum value is operating system dependent.

The middleware must queue samples until they can be sent by the asynchronous publishing thread (as determined by the corresponding DDS::FlowController). The number of samples that will be queued is determined by the DDS::HistoryQosPolicy. When using DDS::HistoryQosPolicyKind::KEEP_LAST_HISTORY_QOS, only the most recent DDS::HistoryQosPolicy::depth samples are kept in the queue. Once unsent samples are removed from the queue, they are no longer available to the asynchronous publishing thread and will therefore never be sent.


Member Data Documentation

Publishing mode.

[default] DDS::PublishModeQosPolicyKind::SYNCHRONOUS_PUBLISH_MODE_QOS

Name of the associated flow controller.

NULL value or zero-length string refers to DDS::DEFAULT_FLOW_CONTROLLER_NAME.

See also:
DDS::DomainParticipant::create_flowcontroller

DDS::DEFAULT_FLOW_CONTROLLER_NAME

DDS::FIXED_RATE_FLOW_CONTROLLER_NAME

DDS::ON_DEMAND_FLOW_CONTROLLER_NAME

[default] DDS::DEFAULT_FLOW_CONTROLLER_NAME


RTI Data Distribution Service .Net APIs Version 4.5e Copyright © 23 Oct 2011 Real-Time Innovations, Inc