7.7.3. Transport Registration

RTI Connext Cert supports different transports, and transports must be registered with Connext Cert before they can be used by an application.

Transports must be registered with a unique name; this name is later used to configure where to send and receive discovery and user data. A transport name cannot exceed seven (7) UTF-8 characters.

Note

The name the transport is registered with has no meaning to Connext Cert. A transport plugin may allow multiple registerations under different names. For example, two UDPv4 transport plugins may be registered, one for discovery and one for user data, with different properties.

The following example registers the UDP transport with RTI Connext Cert and makes it available to all DDS applications within the same memory space. Please note that each DDS applications creates its own instance of a transport based on its QoS policies. Resources are not shared between instances of a transport unless otherwise stated.

For example, to register two UDP transports with the names “myudp1” and “myudp2”, the following code is required:

DDS_DomainParticipantFactory *factory;
RT_Registry_T *registry;

/* In general properties must be available for the lifetime of the
 * transport.
 */
struct UDP_InterfaceFactoryProperty udp_property1;
struct UDP_InterfaceFactoryProperty udp_property2;

factory = DDS_DomainParticipantFactory_get_instance();
registry = DDS_DomainParticipantFactory_get_registry(factory);

/* Set UDP properties */
if (!RT_Registry_register(registry,"myudp1",
                          UDP_InterfaceFactory_get_interface(),
                          &udp_property2._parent._parent,NULL))
{
    return error;
}

/* Set UDP properties */
if (!RT_Registry_register(registry,"myudp2",
                          UDP_InterfaceFactory_get_interface(),
                          &udp_property2._parent._parent,NULL))
{
    return error;
}

Before a DomainParticipant can make use of a registered transport, it must enable it for use within the DomainParticipant. This is done by setting the TransportQoS. For example, to enable only “myudp1”, the following code is required (error checking is not shown for clarity):

DDS_StringSeq_set_maximum(&dp_qos.transports.enabled_transports,1);
DDS_StringSeq_set_length(&dp_qos.transports.enabled_transports,1);
*DDS_StringSeq_get_reference(&dp_qos.transports.enabled_transports,0) =
                                                 REDA_String_dup("myudp1");

To enable both transports:

DDS_StringSeq_set_maximum(&dp_qos.transports.enabled_transports,2);
DDS_StringSeq_set_length(&dp_qos.transports.enabled_transports,2);
*DDS_StringSeq_get_reference(&dp_qos.transports.enabled_transports,0) =
                                                 REDA_String_dup("myudp1");
*DDS_StringSeq_get_reference(&dp_qos.transports.enabled_transports,1) =
                                                 REDA_String_dup("myudp2");

Before enabled transports may be used for communication in Connext Cert, they must be registered and added to the DiscoveryQos and UserTrafficQos policies. Please see the section on Discovery for details.