Setting Up a Transport with the Property QoS

The PROPERTY QosPolicy (DDS Extension) allows you to set up name/value pairs of data and attach them to an entity, such as a DomainParticipant. This will cause Connext DDS to dynamically load the WAN or Secure Transport libraries at run time and then implicitly create and register the transport plugin.

Please refer to Setting Builtin Transport Properties with the PropertyQosPolicy.

To assign properties, use the add_property() operation:

DDS_ReturnCode_t DDSPropertyQosPolicyHelper::add_property  
(DDS_PropertyQosPolicy policy,
const char * name,
const char * value,
DDS_Boolean propagate)

For more information on add_property() and the other operations in the DDSPropertyQosPolicyHelper class, please see PropertyQoSPolicyHelper Operations, as well as the API Reference HTML documentation.

The ‘name’ part of the name/value pairs is a predefined string, described in WAN Transport Properties and Secure Transport Properties.

Here are the basic steps, taken from the example Hello World application (for details, please see the example application.)

  1. Get the default DomainParticipant QoS from the DomainParticipantFactory.
  2. DDSDomainParticipantFactory::get_instance()->
    	get_default_participant_qos(participant_qos);
  3. Disable the builtin transports.
  4. participant_qos.transport_builtin.mask = 
    	DDS_TRANSPORTBUILTIN_MASK_NONE;
  5. Set up the DomainParticipant’s Property QoS.
    1. Load the plugin.
      DDSPropertyQosPolicyHelper::add_property (
      	participant_qos.property, 
      	"dds.transport.load_plugins", 
      	"dds.transport.wan_plugin.wan", 
      	DDS_BOOLEAN_FALSE);
    2. Specify the transport plugin library.
      DDSPropertyQosPolicyHelper::add_property (
      participant_qos.property, 
      	"dds.transport.wan_plugin.wan.library", 
      	"libnddstransportwan.so",
      	DDS_BOOLEAN_FALSE);
    1. Specify the transport’s ‘create’ function.
      DDSPropertyQosPolicyHelper::add_property (
      	participant_qos.property,
      	"dds.transport.wan_plugin.wan.create_function"
      	"NDDS_Transport_WAN_create",
      	DDS_BOOLEAN_FALSE);
    2. Specify the WAN Server and instance ID.
      DDSPropertyQosPolicyHelper::add_property (
      	participant_qos.property
      	"dds.transport.wan_plugin.wan.server", 
      	"192.168.1.1",
      	DDS_BOOLEAN_FALSE);
      DDSPropertyQosPolicyHelper::add_property (
      	participant_qos.property,
      	"dds.transport.wan_plugin.wan.transport_instance_id", 
      	1,
      	DDS_BOOLEAN_FALSE);
    3. Specify any other properties, as needed.
  6. Create the DomainParticipant, using the modified QoS.
  7. participant = DDSTheParticipantFactory->create_participant (
    	domainId,
    participant_qos, NULL /* listener */, DDS_STATUS_MASK_NONE);

Property changes should be made before the transport is loaded: either before the DomainParticipant is enabled, before the first DataWriter/DataReader is created, or before the builtin topic reader is looked up, whichever one happens first.

© 2018 RTI