Explicitly Instantiating the TCP Transport Plugin

As described on , there are two ways to configure a transport plugin. This section describes the way that includes explicitly instantiating and registering a new transport. (The other way is to use the Property QoS mechanism, described in Configuring the TCP Transport with the Property QosPolicy).

Notes:

This way of instantiating a transport is not supported in the Java and .NET APIs. If you are using Java or .NET, use the Property QoS mechanism described in Configuring the TCP Transport with the Property QosPolicy.

To use this mechanism, there are extra libraries that you must link into your program and an additional header file that you must include. Please see Additional Header Files and Include Directories and Additional Libraries and Compiler Flags for details.

To instantiate a TCP transport:

Include the extra header file described in Additional Header Files and Include Directories.

Instantiate a new transport by calling NDDS_Transport_TCPv4_new():

NDDS_Transport_Plugin* NDDS_Transport_TCPv4_new (
const struct NDDS_Transport_TCPv4_Property_t * property_in)

Register the transport by calling NDDSTransportSupport::register_transport().

See the API Reference HTML documentation for details on these functions and the contents of the NDDS_Transport_TCPv4_Property_t structure.

Additional Header Files and Include Directories

To use the TCP Transport API, you must include an extra header file (in addition to those in Header Files to Include for Connext DDS (All Architectures)):

#include "ndds/transport_tcp/transport_tcp_tcpv4.h"

Since TCP Transport is in the same directory as Connext DDS (see Include Paths for Compilation (All Architectures)), no additional include paths need to be added for the TCP Transport API. If this is not the case, you will need to specify the appropriate include path.

Additional Libraries and Compiler Flags

To use the TCP Transport, you must add the nddstransporttcp library to the link phase of your application. There are four different kind of libraries, depending on if you want a debug or release version, and static or dynamic linking with Connext DDS.

For UNIX- based systems, the libraries are:

For Windows-based systems, the libraries are:

Notes for using TLS:

To use either TLS mode (see Choosing a Transport Mode), you also need RTI TLS Support, which is available for purchase as a separate package. The TLS library (libnddstls.so or NDDSTLS.LIB, depending on your platform) must be in your library search path (pointed to by the environment variable LD_LIBRARY_PATH on UNIX/Solaris systems, Path on Windows systems, LIBPATH on AIX systems, DYLD_LIBRARY_PATH on Mac OS systems).

If you already have $NDDSHOME/lib/<architecture> in your library search path, no extra steps are needed to use TLS once TLS Support is installed.

Even if you link everything statically, you must make sure that the location for $NDDSHOME/lib/<architecture> (or wherever the TLS library is located) is in your search path. When the TCP Transport Plugin is explicitly instantiated, the TLS library is loaded dynamically, even if you use static linking for everything else. To load TLS libraries statically, please see Configuring the TCP Transport with the Property QosPolicy.

Your search path must also include the location for the OpenSSL library, which is used by the TLS library.

© 2018 RTI