63.3.2 Installing Transport Plugin Instances with register_transport()

In C and traditional C++, after you create an instance of a transport plugin (see 63.3.1 Explicitly Creating Transport Plugin Instances), you have to register it.

You only need to explicitly register a builtin transport if you want an extra instance of it (suppose you want two UDPv4 transports, one with special settings).

The register_transport() operation registers a transport plugin for use with a DomainParticipant and assigns it a network address.

NDDS_Transport_Handle_t NDDSTransportSupport::register_transport(
	DDSDomainParticipant * participant_in,

NDDS_Transport_Plugin * transport_in,

const DDS_StringSeq & aliases_in,

const NDDS_Transport_Address_t & network_address_in)

Where:

participant_in

A non-NULL, disabled DomainParticipant.

transport_in

A non-NULL transport plugin that is currently not registered with another DomainParticipant.

aliases_in

A non-NULL sequence of strings used as aliases to refer to the transport plugin symbolically. The transport plugin will be "available for use" to an Entity contained in the DomainParticipant, if the transport alias list associated with the Entity contains one of these transport aliases. An empty alias list represents a WILDCARD and matches ALL aliases. See 63.3.2.2 Transport Aliases.

network_address_in

The network address at which to register this transport plugin. The bits indicated by the transport_in.property.address_bit_count will be truncated. The remaining bits are the network address of the transport plugin. See 63.3.2.3 Transport Network Addresses.

Note: You must ensure that the transport plugin instance is only used by one DomainParticipant at a time. See 63.3.2.1 Transport Lifecycles.

Upon success, a valid non-NIL transport handle is returned, representing the association between the DomainParticipant and the transport plugin. If the transport cannot be registered, NDDS_TRANSPORT_HANDLE_NIL is returned.

The C and Traditional C++ APIs also have an operation to retrieve a registered transport plugin, get_transport_plugin(), from one of its aliases.

NDDS_Transport_Plugin* get_transport_plugin(

DDSDomainParticipant* participant_in, const char* alias_in);