RTI TCP Transport  Version 6.0.0
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
TCP Transport Plugin API

TCP Transport Plugin interfaces and definitions. More...

Data Structures

struct  NDDS_Transport_TCPv4_ConnectionLivelinessSettings_t
 Connection liveliness settings. More...
 
struct  NDDS_Transport_TCPv4_EventThreadSettings_t
 Event thread settings. More...
 
struct  NDDS_Transport_TCPv4_WindowsIOCPSettings_t
 Windows I/O completion ports settings. More...
 
struct  NDDS_Transport_TCPv4_Property_t
 Configurable TCP Transport-Plugin properties. More...
 

Macros

#define NDDS_TRANSPORT_CLASSNAME_TCPV4_LAN   "tcpv4_lan"
 IPv4 TCP/IP Transport-Plugin class name for LAN case.
 
#define NDDS_TRANSPORT_CLASSNAME_TCPV4_WAN   "tcpv4_wan"
 IPv4 TCP/IP Transport-Plugin class name for WAN case.
 
#define NDDS_TRANSPORT_TCPV4_DEFAULT_PORT_NUMBER   7400
 The default value for the server bind port.
 
#define NDDS_TRANSPORT_TCPV4_MESSAGE_SIZE_MAX_DEFAULT   (65536)
 Default value of maximum message size.
 
#define NDDS_TRANSPORT_TCPV4_SOCKET_BUFFER_SIZE_OS_DEFAULT   (-1)
 Used to specify that os default should be used for the socket buffer size.
 
#define NDDS_TRANSPORT_TCPV4_SEND_SOCKET_BUFFER_SIZE_DEFAULT   (131072)
 Default value of NDDS_Transport_Property_t::send_socket_buffer_size.
 
#define NDDS_TRANSPORT_TCPV4_RECV_SOCKET_BUFFER_SIZE_DEFAULT   (131072)
 Default value of NDDS_Transport_Property_t::recv_socket_buffer_size.
 
#define NDDS_TRANSPORT_TCPV4_SERVER_SOCKET_BACKLOG_DEFAULT   (5)
 The max number of pending connections waiting for the control thread to accept them.
 
#define NDDS_TRANSPORT_TCPV4_ADDRESS_BIT_COUNT   (64)
 Number of signficant bits of 16-byte address.
 
#define NDDS_TRANSPORT_TCPV4_READ_BUFFER_POOL_GROWTH_POLICY_DEFAULT   NDDS_TRANSPORT_ALLOCATION_SETTINGS_DEFAULT
 The default settings for the buffer pool used to provide memory for the received messages.
 
#define NDDS_TRANSPORT_TCPV4_WRITE_BUFFER_POOL_GROWTH_POLICY_DEFAULT   { 4L, 1000L, 10L}
 The default settings for the buffer used to provide memory for the bytes being written using asynchronous send.
 
#define NDDS_TRANSPORT_TCPV4_CONTROL_BUFFER_POOL_GROWTH_POLICY_DEFAULT   NDDS_TRANSPORT_ALLOCATION_SETTINGS_DEFAULT
 The default settings for the buffer pool used to provide memory for the control messages read or written.
 
#define NDDS_TRANSPORT_TCPV4_CONTROL_MESSAGE_FACTORY_GROWTH_POLICY_DEFAULT   NDDS_TRANSPORT_ALLOCATION_SETTINGS_DEFAULT
 The default settings for the buffer used to provide memory for the control message factory.
 
#define NDDS_TRANSPORT_TCPV4_CONTROL_MESSAGE_ATTRIBUTE_FACTORY_GROWTH_POLICY_DEFAULT   NDDS_TRANSPORT_ALLOCATION_SETTINGS_DEFAULT
 The default settings for the buffer used to provide memory for the control message attribute factory.
 
#define NDDS_TRANSPORT_TCPV4_CONNECTION_LIVELINESS_SETTINGS_DEFAULT
 Use this to initialize a NDDS_Transport_TCPv4_ConnectionLivelinessSettings_t structure.
 
#define NDDS_TRANSPORT_TCPV4_EVENT_THREAD_SETTINGS_DEFAULT
 Use this to initialize a NDDS_Transport_TCPv4_EventThreadSettings_t structure.
 
#define NDDS_TRANSPORT_TCPV4_WINDOWS_IOCP_SETTINGS_DEFAULT
 Use this to initialize a NDDS_Transport_TCPv4_WindowsIOCPSettings_t structure.
 
#define NDDS_TRANSPORT_TCPV4_PROPERTY_DEFAULT_LAN
 Use this to initialize a NDDS_Transport_TCPv4_Property_t structure for LAN communication.
 
#define NDDS_TRANSPORT_TCPV4_PROPERTY_DEFAULT   NDDS_TRANSPORT_TCPV4_PROPERTY_DEFAULT_LAN
 Use this to initialize a NDDS_Transport_TCPv4_Property_t structure.
 
#define NDDS_TRANSPORT_TCPV4_ADDRESS_LOCALHOST   {{0,0,0,0, 0,0,0,0, 0xff,0xff, 0x1c, 0xe8, 127,0,0,1}}
 The definition of localhost for the TCP transport: 127.0.0.1:7400.
 

Typedefs

typedef void(* NDDS_Transport_TCPv4_OnConnectionEstablishedCallback )(RTI_UINT32 remote_peer_addresss, RTI_UINT16 remote_peer_port)
 Prototype of the function that can be called when a new connection is successfully established with a remote peer.
 
typedef void(* NDDS_Transport_TCPv4_OnConnectionLostCallback )(RTI_UINT32 remote_peer_addresss, RTI_UINT16 remote_peer_port, NDDS_Transport_TCPv4_OnConnectionLost_ReasonCode_t reason)
 Prototype of the function that can be called when an existing connection is lost.
 

Enumerations

enum  NDDS_Transport_TCPv4_OnConnectionLost_ReasonCode_t {
  NDDS_TRANSPORT_TCPV4_ON_CONNECTION_LOST_REASON_UNKNOWN = 0,
  NDDS_TRANSPORT_TCPV4_ON_CONNECTION_LOST_REASON_CODE_FINALIZED,
  NDDS_TRANSPORT_TCPV4_ON_CONNECTION_LOST_REASON_CODE_BROKEN_PIPE,
  NDDS_TRANSPORT_TCPV4_ON_CONNECTION_LOST_REASON_DESTROYED
}
 A set of possible reasons why a connection is lost. More...
 
enum  NDDS_Transport_TCPv4_SocketMonitoringKind_t {
  NDDS_TRANSPORT_TCPV4_SOCKET_MONITORING_KIND_WINDOWS_WAITFORMULTIPLEOBJECTS = 0,
  NDDS_TRANSPORT_TCPV4_SOCKET_MONITORING_KIND_SELECT = 1,
  NDDS_TRANSPORT_TCPV4_SOCKET_MONITORING_KIND_WINDOWS_IOCP = 2
}
 Possible values for the socket monitoring API. More...
 

Functions

NDDS_Transport_Plugin * NDDS_Transport_TCPv4_new (const struct NDDS_Transport_TCPv4_Property_t *property_in)
 Creates an instance of the TCP transport plugin and initializes it from the specified TCP transport property structure.
 
NDDS_Transport_Plugin * NDDS_Transport_TCPv4_create (NDDS_Transport_Address_t *default_network_address_out, const struct DDS_PropertyQosPolicy *property_in)
 Creates an instance of a TCP Transport Plugin, using PropertyQosPolicy.
 
RTIBool NDDS_Transport_TCPv4_Plugin_stringToTransportAddress (NDDS_Transport_Address_t *address_out, const char *address_in, RTIBool acceptHostName_in)
 Converts a string into a transport address suitable to be used with the TCP transport.
 

Detailed Description

TCP Transport Plugin interfaces and definitions.

Macro Definition Documentation

#define NDDS_TRANSPORT_CLASSNAME_TCPV4_LAN   "tcpv4_lan"

IPv4 TCP/IP Transport-Plugin class name for LAN case.

#define NDDS_TRANSPORT_CLASSNAME_TCPV4_WAN   "tcpv4_wan"

IPv4 TCP/IP Transport-Plugin class name for WAN case.

#define NDDS_TRANSPORT_TCPV4_DEFAULT_PORT_NUMBER   7400

The default value for the server bind port.

#define NDDS_TRANSPORT_TCPV4_MESSAGE_SIZE_MAX_DEFAULT   (65536)

Default value of maximum message size.

#define NDDS_TRANSPORT_TCPV4_SOCKET_BUFFER_SIZE_OS_DEFAULT   (-1)

Used to specify that os default should be used for the socket buffer size.

#define NDDS_TRANSPORT_TCPV4_SEND_SOCKET_BUFFER_SIZE_DEFAULT   (131072)

Default value of NDDS_Transport_Property_t::send_socket_buffer_size.

#define NDDS_TRANSPORT_TCPV4_RECV_SOCKET_BUFFER_SIZE_DEFAULT   (131072)

Default value of NDDS_Transport_Property_t::recv_socket_buffer_size.

#define NDDS_TRANSPORT_TCPV4_SERVER_SOCKET_BACKLOG_DEFAULT   (5)

The max number of pending connections waiting for the control thread to accept them.

#define NDDS_TRANSPORT_TCPV4_ADDRESS_BIT_COUNT   (64)

Number of signficant bits of 16-byte address.

#define NDDS_TRANSPORT_TCPV4_READ_BUFFER_POOL_GROWTH_POLICY_DEFAULT   NDDS_TRANSPORT_ALLOCATION_SETTINGS_DEFAULT

The default settings for the buffer pool used to provide memory for the received messages.

#define NDDS_TRANSPORT_TCPV4_WRITE_BUFFER_POOL_GROWTH_POLICY_DEFAULT   { 4L, 1000L, 10L}

The default settings for the buffer used to provide memory for the bytes being written using asynchronous send.

#define NDDS_TRANSPORT_TCPV4_CONTROL_BUFFER_POOL_GROWTH_POLICY_DEFAULT   NDDS_TRANSPORT_ALLOCATION_SETTINGS_DEFAULT

The default settings for the buffer pool used to provide memory for the control messages read or written.

#define NDDS_TRANSPORT_TCPV4_CONTROL_MESSAGE_FACTORY_GROWTH_POLICY_DEFAULT   NDDS_TRANSPORT_ALLOCATION_SETTINGS_DEFAULT

The default settings for the buffer used to provide memory for the control message factory.

#define NDDS_TRANSPORT_TCPV4_CONTROL_MESSAGE_ATTRIBUTE_FACTORY_GROWTH_POLICY_DEFAULT   NDDS_TRANSPORT_ALLOCATION_SETTINGS_DEFAULT

The default settings for the buffer used to provide memory for the control message attribute factory.

#define NDDS_TRANSPORT_TCPV4_CONNECTION_LIVELINESS_SETTINGS_DEFAULT
Value:
{ \
0, /* enable */ \
10, /* lease_duration */ \
3 /* assertions_per_lease_duration */ \
}

Use this to initialize a NDDS_Transport_TCPv4_ConnectionLivelinessSettings_t structure.

#define NDDS_TRANSPORT_TCPV4_EVENT_THREAD_SETTINGS_DEFAULT
Value:
{ \
RTI_OSAPI_THREAD_PRIORITY_DEFAULT, /* priority */ \
RTI_OSAPI_THREAD_STACK_SIZE_DEFAULT, /* stack_size */ \
RTI_OSAPI_THREAD_OPTION_PRIORITY_ENFORCE | RTI_OSAPI_THREAD_OPTION_STDIO /* options */ \
}

Use this to initialize a NDDS_Transport_TCPv4_EventThreadSettings_t structure.

#define NDDS_TRANSPORT_TCPV4_WINDOWS_IOCP_SETTINGS_DEFAULT
Value:
{ \
1, /* windows_iocp_concurrency_value */ \
2, /* windows_iocp_thread_pool_size */ \
RTI_OSAPI_THREAD_PRIORITY_DEFAULT, /* windows_iocp_thread_priority */ \
RTI_OSAPI_THREAD_STACK_SIZE_DEFAULT, /* windows_iocp_thread_stack_size */ \
}

Use this to initialize a NDDS_Transport_TCPv4_WindowsIOCPSettings_t structure.

#define NDDS_TRANSPORT_TCPV4_PROPERTY_DEFAULT_LAN
Value:
{ \
{ /* parent */ \
NDDS_TRANSPORT_CLASSID_TCPV4_LAN, /* classid */ \
NDDS_TRANSPORT_TCPV4_ADDRESS_BIT_COUNT, /* address_bit_count */ \
NDDS_TRANSPORT_PROPERTY_BIT_BUFFER_ALWAYS_LOANED, /* properties_bitmap */ \
128, /* gather_send_buffer_count_max */ \
NDDS_TRANSPORT_TCPV4_MESSAGE_SIZE_MAX_DEFAULT, /* message_size_max */ \
NULL, /* allow_interfaces_list */ \
0, /* allow_interfaces_list_length */ \
NULL, /* deny_interfaces_list */ \
0, /* deny_interfaces_list_length;*/ \
NULL, /* allow_multicast_interfaces_list */ \
0, /* allow_multicast_interfaces_list_length */ \
NULL, /* deny_multicast_interfaces_list */ \
0, /* deny_multicast_interfaces_list_length */ \
NULL /* domain_participant_ptr */ \
}, \
NDDS_TRANSPORT_TCPV4_SEND_SOCKET_BUFFER_SIZE_DEFAULT, /* send_socket_buffer_size */ \
NDDS_TRANSPORT_TCPV4_RECV_SOCKET_BUFFER_SIZE_DEFAULT, /* recv_socket_buffer_size */ \
1, /* ignore_loopback_interface */ \
1, /* ignore_nonrunning_interfaces */ \
0, 0, 0xffL, /* transport priority mapping */ \
500, /* interface_poll_period (in millisec) */ \
NDDS_TRANSPORT_TCPV4_TRANSPORT_MODE_SYMMETRIC, /* transport_mode (deprecated) */ \
NDDS_TRANSPORT_TCPV4_SERVER_SOCKET_BACKLOG_DEFAULT, /* server_socket_backlog */ \
NDDS_TRANSPORT_ADDRESS_INVALID, /* public_address */ \
NULL, /* bind_interface_address */ \
NDDS_TRANSPORT_TCPV4_DEFAULT_PORT_NUMBER, /*server_bind_port */ \
NDDS_TRANSPORT_TCPV4_READ_BUFFER_POOL_GROWTH_POLICY_DEFAULT, /* read_buffer_allocation */ \
NDDS_TRANSPORT_TCPV4_WRITE_BUFFER_POOL_GROWTH_POLICY_DEFAULT, /* write_buffer_allocation */ \
NDDS_TRANSPORT_TCPV4_CONTROL_BUFFER_POOL_GROWTH_POLICY_DEFAULT, /* control_buffer_allocation */ \
NDDS_TRANSPORT_TCPV4_CONTROL_MESSAGE_FACTORY_GROWTH_POLICY_DEFAULT, /* control_message_allocation */ \
NDDS_TRANSPORT_TCPV4_CONTROL_MESSAGE_ATTRIBUTE_FACTORY_GROWTH_POLICY_DEFAULT, /* control_attribute_allocation */ \
0, /* force_asynchronous_send */ \
NULL, /* on_connection_established */ \
NULL, /* on_connection_lost */ \
-1L, /* max_packet_size */ \
0, /* enable_keep_alive */ \
-1L, /* keep_alive_time */ \
-1L, /* keep_alive_internal */ \
-1L, /* keep_alive_retry_count */ \
0, /* user_timeout */ \
NDDS_TRANSPORT_TCPV4_CONNECTION_LIVELINESS_SETTINGS_DEFAULT, /* connection_liveliness_settings */ \
NDDS_TRANSPORT_TCPV4_EVENT_THREAD_SETTINGS_DEFAULT, /* event_thread_settings */ \
0, /* disable_nagle */ \
-1L, /* logging_verbosity_bitmap */ \
-1L, /* security_logging_verbosity_bitmap */ \
-1L, /* use_windows_select */ \
NDDS_TRANSPORT_TCPV4_SOCKET_MONITORING_KIND_SELECT, /* socket_monitoring_kind */ \
NDDS_TRANSPORT_TCPV4_WINDOWS_IOCP_SETTINGS_DEFAULT, /* windows_iocp_settings */ \
0, /*send_crc*/ \
0, /*force_crc_check*/ \
0, /* negotiate_session_id */ \
100, /* outstanding_connection_cookies */ \
-1L, /* outstanding_connection_cookies_life_span */ \
3, /* send_max_wait_sec */ \
10, /* client_connection_negotiation_timeout */ \
10, /* server_connection_negotiation_timeout */ \
10, /* initial_handshake_timeout */ \
RTITLS_OPENSSL_CONFIGURATION_DEFAULT, /* tls */ \
NULL, /* connection_endpoint_factory_create_fcn */ \
NULL, /* connection_endpoint_factory_delete_fcn */ \
0, /* disable_interface_tracking */ \
NULL /* reserved */ \
}

Use this to initialize a NDDS_Transport_TCPv4_Property_t structure for LAN communication.

#define NDDS_TRANSPORT_TCPV4_PROPERTY_DEFAULT   NDDS_TRANSPORT_TCPV4_PROPERTY_DEFAULT_LAN

Use this to initialize a NDDS_Transport_TCPv4_Property_t structure.

#define NDDS_TRANSPORT_TCPV4_ADDRESS_LOCALHOST   {{0,0,0,0, 0,0,0,0, 0xff,0xff, 0x1c, 0xe8, 127,0,0,1}}

The definition of localhost for the TCP transport: 127.0.0.1:7400.

Typedef Documentation

typedef void(* NDDS_Transport_TCPv4_OnConnectionEstablishedCallback)(RTI_UINT32 remote_peer_addresss, RTI_UINT16 remote_peer_port)

Prototype of the function that can be called when a new connection is successfully established with a remote peer.

Parameters
remote_peer_addresssthe address of the remote peer connected encoded as network-ordered IPv4 address.
remote_peer_portthe port number of the remote connection encoded as network-ordered 16-bit value
typedef void(* NDDS_Transport_TCPv4_OnConnectionLostCallback)(RTI_UINT32 remote_peer_addresss, RTI_UINT16 remote_peer_port, NDDS_Transport_TCPv4_OnConnectionLost_ReasonCode_t reason)

Prototype of the function that can be called when an existing connection is lost.

This method is always called after the on_connection_established is called.

It is also called if a sendresource or recvresource is destroyed (after closing the existing connections), and on shutdown

Parameters
remote_peer_addresssthe address of the remote peer connected encoded as network-ordered IPv4 address.
remote_peer_portthe port number of the remote connection encoded as network-ordered 16-bit value
reasonan enumeration that describes the reason of the disconnection

Enumeration Type Documentation

A set of possible reasons why a connection is lost.

See Also
NDDS_Transport_TCPv4_OnConnectionLostCallback
Enumerator:
NDDS_TRANSPORT_TCPV4_ON_CONNECTION_LOST_REASON_UNKNOWN 

The reason why the connection was closed is not known

NDDS_TRANSPORT_TCPV4_ON_CONNECTION_LOST_REASON_CODE_FINALIZED 

Server side: connection closed by remote client. Client side: the internal send resource was destroyed.

NDDS_TRANSPORT_TCPV4_ON_CONNECTION_LOST_REASON_CODE_BROKEN_PIPE 

Describes a condition where the remote peer has ungracefully closed the connection (app was crashed or suddenly interrupted)

NDDS_TRANSPORT_TCPV4_ON_CONNECTION_LOST_REASON_DESTROYED 

Describes a condition where the current node has decided to close the connection.

Possible values for the socket monitoring API.

The socket monitoring API is configured using the property socket_monitoring_kind

See Also
NDDS_Transport_TCPv4_Property_t.
Enumerator:
NDDS_TRANSPORT_TCPV4_SOCKET_MONITORING_KIND_WINDOWS_WAITFORMULTIPLEOBJECTS 

The transport uses the API WaitForMultipleObjects to monitor sockets.

This value only applies to Windows systems.

NDDS_TRANSPORT_TCPV4_SOCKET_MONITORING_KIND_SELECT 

The transport uses the POSIX select API to monitor sockets.

NDDS_TRANSPORT_TCPV4_SOCKET_MONITORING_KIND_WINDOWS_IOCP 

The transport uses Windows I/O completion ports to monitor sockets.

This value only applies to Windows systems.

Function Documentation

NDDS_Transport_Plugin* NDDS_Transport_TCPv4_new ( const struct NDDS_Transport_TCPv4_Property_t property_in)

Creates an instance of the TCP transport plugin and initializes it from the specified TCP transport property structure.

This is the main initializer of the TCP transport plugin. To use the default settings, pass a pointer to a struct NDDS_Transport_TCPv4_Property_t initialized with the macro NDDS_TRANSPORT_TCPV4_PROPERTY_DEFAULT.

Parameters
property_in<<in>> A pointer to a struct NDDS_Transport_TCPv4_Property_t containing the transport property. The plugin will make a copy of this structure before returning (caller can safely destroy the object).
Returns
A pointer to a newly instantiated plugin or NULL if an error occurred during creation.
NDDS_Transport_Plugin* NDDS_Transport_TCPv4_create ( NDDS_Transport_Address_t default_network_address_out,
const struct DDS_PropertyQosPolicy property_in 
)

Creates an instance of a TCP Transport Plugin, using PropertyQosPolicy.

For all the properties that are not specified, the default value is assumed (as described in Configure TCP Transport with Property QoS Policy).

Parameters
default_network_address_out<<out>> Unused parameter
property_in<<in>> The DDS_PropertyQoSPolicy object containing the transport properties.
Returns
A pointer to a newly instantiated plugin or NULL if an error occurred during creation.
RTIBool NDDS_Transport_TCPv4_Plugin_stringToTransportAddress ( NDDS_Transport_Address_t address_out,
const char *  address_in,
RTIBool  acceptHostName_in 
)

Converts a string into a transport address suitable to be used with the TCP transport.

This method will convert a string in the form host:port into a NDDS_Transport_Address_t structure.

If the 'port' component is not specified, it will assign the default value as described by the constant NDDS_TRANSPORT_TCPV4_DEFAULT_PORT_NUMBER.

Parameters
address_out<<out>> Transport address to initialize
address_in<<in>> the NULL-terminated string containing the address to parse
acceptHostName_in<<in>> Set it to RTI_TRUE to allow this function to resolve the host component of the string address through a DNS lookup; set it to RTI_FALSE to allow only IPv4 addresses in the 'host' part of the address string.
Returns
RTI_TRUE if success or RTI_FALSE if an error occurred during the conversion.

RTI TCP Transport Version 6.0.0 Copyright © Sun Mar 3 2019 Real-Time Innovations, Inc