52.6 Enabling Real-Time WAN Transport

To use Real-Time WAN Transport, you have two options:

Note: Normally, you cannot mix static and dynamic libraries (see Building Applications chapter in the RTI Connext Core Libraries Platform Notes). For Real-Time WAN Transport, however, it is recommended that you load the library dynamically, regardless of how you load your core libraries. There is one exception: if your platform does not support dynamic loading, follow the instructions in 52.6.2 Linking the Real-Time WAN Transport against your Application for more information on how to link your application against the corresponding Real-Time WAN Transport library.

52.6.1 Dynamically Loading the Real-Time WAN Transport

The recommended way to use the transport is to let Connext automatically load the Real-Time WAN Transport dynamic library. (Not all platforms support dynamic loading. See the RTI Connext Core Libraries Platform Notes for details.)

To allow Connext to load the Real-Time WAN Transport dynamic library, simply make sure that the applicable Real-Time WAN Transport dynamic Release or Debug library is available in your system library search path (e.g., LD_LIBRARY_PATH in Linux systems, PATH on Windows systems, DYLD_LIBRARY_PATH on macOS systems).

52.6.2 Linking the Real-Time WAN Transport against your Application

If the method described in 52.6.1 Dynamically Loading the Real-Time WAN Transport is not available on your system (because your architecture does not support dynamic library loading), you can still use the Real-Time WAN Transport by linking your application against the transport library.

Compared with dynamic loading, you need to pay attention to two things:

First, include the Real-Time WAN Transport library in the list of libraries used during your application linking. See the RTI Connext Core Libraries Platform Notes for the specific library to link for your target platform.

Second, manually tell Connext the pointer to the function of the entry point of the Real-Time WAN Transport library before you create the DomainParticipant. Setting this pointer requires setting the dds.transport.UDPv4_WAN.builtin.plugin_enabled_function_ptr property. (See 52.8.1 Setting Real-Time WAN Transport Properties.) Here is an example of how to set this pointer in code:

/* Include the symbol for NDDS_Transport_UDP_WAN_Library_is_plugin_enabled */
#include "transport/transport_udp_wan_library.h"
 
  /* The property name "dds.transport.UDPv4_WAN.builtin.plugin_enabled_function_ptr"
   * indicates the entry point for the Real-Time WAN Transport library.
   * The value MUST be the stringified value of the function pointer of
   * NDDS_Transport_UDP_WAN_Library_is_plugin_enabled. Note that
   * add_pointer_property() API will automatically convert the
   * function pointer to a string.
   */
if (DDS_PropertyQosPolicyHelper_add_pointer_property(
      &participantQos.property,
      "dds.transport.UDPv4_WAN.builtin.plugin_enabled_function_ptr",
      (void *) NDDS_Transport_UDP_WAN_Library_is_plugin_enabled)
    != DDS_RETCODE_OK) {
  /* error */
}