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.)
DDSDomainParticipantFactory::get_instance()->
get_default_participant_qos(participant_qos);
participant_qos.transport_builtin.mask = DDS_TRANSPORTBUILTIN_MASK_NONE;
DDSPropertyQosPolicyHelper::add_property ( participant_qos.property, "dds.transport.load_plugins", "dds.transport.wan_plugin.wan", DDS_BOOLEAN_FALSE);
DDSPropertyQosPolicyHelper::add_property ( participant_qos.property, "dds.transport.wan_plugin.wan.library", "libnddstransportwan.so", DDS_BOOLEAN_FALSE);
DDSPropertyQosPolicyHelper::add_property ( participant_qos.property, "dds.transport.wan_plugin.wan.create_function" "NDDS_Transport_WAN_create", DDS_BOOLEAN_FALSE);
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);
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.
© 2016 RTI