This is the base class for chaining adapter transports. More...
#include <ChainingTransport.hpp>
Public Member Functions | |
FASTDDS_EXPORTED_API | ChainingTransport (const ChainingTransportDescriptor &t) |
Constructor. | |
virtual FASTDDS_EXPORTED_API | ~ChainingTransport ()=default |
Destructor. | |
FASTDDS_EXPORTED_API bool | init (const fastdds::rtps::PropertyPolicy *properties=nullptr, const uint32_t &max_msg_size_no_frag=0) override |
Initialize the low-level transport. | |
FASTDDS_EXPORTED_API bool | IsInputChannelOpen (const fastdds::rtps::Locator_t &loc) const override |
Call the low-level transport IsInputChannelOpen() . | |
FASTDDS_EXPORTED_API bool | IsLocatorSupported (const fastdds::rtps::Locator_t &loc) const override |
Call the low-level transport IsLocatorSupported() . | |
FASTDDS_EXPORTED_API fastdds::rtps::Locator_t | RemoteToMainLocal (const fastdds::rtps::Locator_t &loc) const override |
Call the low-level transport RemoteToMainLocal() . | |
FASTDDS_EXPORTED_API bool | OpenInputChannel (const fastdds::rtps::Locator_t &loc, TransportReceiverInterface *receiver_interface, uint32_t max_message_size) override |
Call the low-level transport OpenInputChannel() . | |
FASTDDS_EXPORTED_API bool | OpenOutputChannel (SendResourceList &sender_resource_list, const fastdds::rtps::Locator_t &loc) override |
Call the low-level transport OpenOutputChannel() . | |
FASTDDS_EXPORTED_API bool | CloseInputChannel (const fastdds::rtps::Locator_t &loc) override |
Call the low-level transport CloseInputChannel() . | |
FASTDDS_EXPORTED_API fastdds::rtps::LocatorList_t | NormalizeLocator (const fastdds::rtps::Locator_t &locator) override |
Call the low-level transport NormalizeLocator() . | |
FASTDDS_EXPORTED_API bool | is_local_locator (const fastdds::rtps::Locator_t &locator) const override |
Call the low-level transport is_local_locator() . | |
FASTDDS_EXPORTED_API bool | is_localhost_allowed () const override |
Call the low-level transport is_localhost_allowed() . | |
FASTDDS_EXPORTED_API NetmaskFilterInfo | netmask_filter_info () const override |
Call the low-level transport netmask_filter_info() . | |
FASTDDS_EXPORTED_API bool | DoInputLocatorsMatch (const fastdds::rtps::Locator_t &locator_1, const fastdds::rtps::Locator_t &locator_2) const override |
Call the low-level transport DoInputLocatorsMatch() . | |
FASTDDS_EXPORTED_API void | select_locators (fastdds::rtps::LocatorSelector &selector) const override |
Call the low-level transport select_locators() . | |
FASTDDS_EXPORTED_API void | AddDefaultOutputLocator (fastdds::rtps::LocatorList_t &defaultList) override |
Call the low-level transport AddDefaultOutputLocator() . | |
FASTDDS_EXPORTED_API bool | getDefaultMetatrafficMulticastLocators (fastdds::rtps::LocatorList_t &locators, uint32_t metatraffic_multicast_port) const override |
Call the low-level transport getDefaultMetatrafficMulticastLocators() . | |
FASTDDS_EXPORTED_API bool | getDefaultMetatrafficUnicastLocators (fastdds::rtps::LocatorList_t &locators, uint32_t metatraffic_unicast_port) const override |
Call the low-level transport getDefaultMetatrafficUnicastLocators() . | |
FASTDDS_EXPORTED_API bool | getDefaultUnicastLocators (fastdds::rtps::LocatorList_t &locators, uint32_t unicast_port) const override |
Call the low-level transport getDefaultUnicastLocators() . | |
FASTDDS_EXPORTED_API bool | fillMetatrafficMulticastLocator (fastdds::rtps::Locator_t &locator, uint32_t metatraffic_multicast_port) const override |
Call the low-level transport fillMetatrafficMulticastLocator() . | |
FASTDDS_EXPORTED_API bool | fillMetatrafficUnicastLocator (fastdds::rtps::Locator_t &locator, uint32_t metatraffic_unicast_port) const override |
Call the low-level transport fillMetatrafficUnicastLocator() . | |
FASTDDS_EXPORTED_API bool | configureInitialPeerLocator (fastdds::rtps::Locator_t &locator, const fastdds::rtps::PortParameters &port_params, uint32_t domainId, fastdds::rtps::LocatorList_t &list) const override |
Call the low-level transport configureInitialPeerLocator() . | |
FASTDDS_EXPORTED_API bool | fillUnicastLocator (fastdds::rtps::Locator_t &locator, uint32_t well_known_port) const override |
Call the low-level transport fillUnicastLocator() . | |
FASTDDS_EXPORTED_API bool | transform_remote_locator (const fastdds::rtps::Locator_t &remote_locator, fastdds::rtps::Locator_t &result_locator) const override |
Call the low-level transport transform_remote_locator() . | |
FASTDDS_EXPORTED_API uint32_t | max_recv_buffer_size () const override |
Call the low-level transport max_recv_buffer_size() . | |
virtual FASTDDS_EXPORTED_API bool | send (fastdds::rtps::SenderResource *low_sender_resource, const std::vector< NetworkBuffer > &buffers, uint32_t total_bytes, fastdds::rtps::LocatorsIterator *destination_locators_begin, fastdds::rtps::LocatorsIterator *destination_locators_end, const std::chrono::steady_clock::time_point &timeout)=0 |
Blocking Send through the specified channel. | |
virtual FASTDDS_EXPORTED_API void | receive (TransportReceiverInterface *next_receiver, const fastdds::rtps::octet *receive_buffer, uint32_t receive_buffer_size, const fastdds::rtps::Locator_t &local_locator, const fastdds::rtps::Locator_t &remote_locator)=0 |
Blocking Receive from the specified channel. | |
FASTDDS_EXPORTED_API void | update_network_interfaces () override |
Update network interfaces. | |
FASTDDS_EXPORTED_API bool | transform_remote_locator (const fastdds::rtps::Locator_t &remote_locator, fastdds::rtps::Locator_t &result_locator, bool allowed_remote_localhost, bool allowed_local_localhost) const override |
Call the low-level transport transform_remote_locator() . | |
FASTDDS_EXPORTED_API bool | is_locator_allowed (const fastdds::rtps::Locator_t &locator) const override |
Call the low-level transport is_locator_allowed() . | |
FASTDDS_EXPORTED_API bool | is_locator_reachable (const fastdds::rtps::Locator_t &locator) override |
Call the low-level transport is_locator_reachable() . | |
![]() | |
virtual | ~TransportInterface ()=default |
Aside from the API defined here, an user-defined Transport must define a descriptor data type and a constructor that expects a constant reference to such descriptor. | |
TransportInterface (const TransportInterface &t)=delete | |
Copy constructor. | |
TransportInterface & | operator= (const TransportInterface &t)=delete |
Copy assignment. | |
TransportInterface (TransportInterface &&t)=delete | |
Move constructor. | |
TransportInterface & | operator= (TransportInterface &&t)=delete |
Move assignment. | |
virtual bool | OpenOutputChannels (SendResourceList &sender_resource_list, const fastdds::rtps::LocatorSelectorEntry &locator_selector_entry) |
Must open the channel that maps to/from the given locator selector entry. | |
virtual void | CloseOutputChannels (SendResourceList &sender_resource_list, const fastdds::rtps::LocatorSelectorEntry &locator_selector_entry) |
Close the channel that maps to/from the given locator selector entry. | |
virtual TransportDescriptorInterface * | get_configuration ()=0 |
Return the transport configuration (Transport Descriptor) | |
virtual void | shutdown () |
Shutdown method to close the connections of the transports. | |
int32_t | kind () const |
Return the transport kind. | |
Protected Attributes | |
std::unique_ptr< TransportInterface > | low_level_transport_ |
![]() | |
int32_t | transport_kind_ |
Additional Inherited Members | |
![]() | |
TransportInterface (int32_t transport_kind) | |
This is the base class for chaining adapter transports.
|
inline |
Constructor.
|
virtualdefault |
Destructor.
|
inlineoverridevirtual |
Call the low-level transport AddDefaultOutputLocator()
.
Add default output locator to the locator list
Implements TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport CloseInputChannel()
.
Must close the channel that maps to/from the given locator. IMPORTANT: It MUST be safe to call this method even during a Receive operation on another thread. You must implement any necessary mutual exclusion and timeout mechanisms to make sure the channel can be closed without damage.
Implements TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport configureInitialPeerLocator()
.
Configure the initial peer locators list
Implements TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport DoInputLocatorsMatch()
.
Must report whether two locators map to the same internal channel.
Implements TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport fillMetatrafficMulticastLocator()
.
Assign port to the given metatraffic multicast locator if not already defined
Implements TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport fillMetatrafficUnicastLocator()
.
Assign port to the given metatraffic unicast locator if not already defined
Implements TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport fillUnicastLocator()
.
Assign port to the given unicast locator if not already defined
Implements TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport getDefaultMetatrafficMulticastLocators()
.
Add metatraffic multicast locator with the given port
Implements TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport getDefaultMetatrafficUnicastLocators()
.
Add metatraffic unicast locator with the given port
Implements TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport getDefaultUnicastLocators()
.
Add unicast locator with the given port
Implements TransportInterface.
|
inlineoverridevirtual |
Initialize the low-level transport.
This method will prepare all the internals of the transport.
properties | Optional policy to specify additional parameters of the created transport. |
max_msg_size_no_frag | Optional maximum message size to avoid 65500 KB fragmentation limit. |
Implements TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport is_local_locator()
.
Must report whether the given locator is from the local host
Implements TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport is_localhost_allowed()
.
Must report whether localhost locator is allowed
Reimplemented from TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport is_locator_allowed()
.
Must report whether the given locator is allowed by this transport.
Implements TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport is_locator_reachable()
.
Must report whether the given locator is reachable by this transport.
Implements TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport IsInputChannelOpen()
.
Must report whether the input channel associated to this locator is open. Channels must either be fully closed or fully open, so that "open" and "close" operations are whole and definitive.
Implements TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport IsLocatorSupported()
.
Must report whether the given locator is supported by this transport (typically inspecting its "kind" value).
Implements TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport max_recv_buffer_size()
.
Implements TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport netmask_filter_info()
.
Returns netmask filter information (transport's netmask filter kind and allowlist)
Reimplemented from TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport NormalizeLocator()
.
Performs locator normalization (assign valid IP if not defined by user)
Implements TransportInterface.
|
overridevirtual |
Call the low-level transport OpenInputChannel()
.
Opens an input channel to receive incoming connections. If there is an existing channel it registers the receiver interface.
Implements TransportInterface.
|
overridevirtual |
Call the low-level transport OpenOutputChannel()
.
Must open the channel that maps to/from the given locator. This method must allocate, reserve and mark any resources that are needed for said channel.
Implements TransportInterface.
|
pure virtual |
Blocking Receive from the specified channel.
It may perform operations on the input buffer. At the end the function must call to the next_receiver
's OnDataReceived
function.
next_receiver | Next resource receiver to be called. | |
receive_buffer | vector with enough capacity (not size) to accommodate a full receive buffer. That capacity must not be less than the receiveBufferSize supplied to this class during construction. | |
receive_buffer_size | Size of the raw data. It will be used as bounds check for the previous argument. It must not exceed the receiveBufferSize fed to this class during construction. | |
local_locator | Locator mapping to the local channel we're listening to. | |
[out] | remote_locator | Locator describing the remote destination we received a packet from. |
|
inlineoverridevirtual |
Call the low-level transport RemoteToMainLocal()
.
Returns the locator describing the main (most general) channel that can write to the provided remote locator.
Implements TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport select_locators()
.
Performs the locator selection algorithm for this transport.
Implements TransportInterface.
|
pure virtual |
Blocking Send through the specified channel.
It may perform operations on the output buffer. At the end the function must call to the low-level transport's send()
function.
low_sender_resource | SenderResource generated by the lower transport. |
buffers | Vector of buffers to send. |
total_bytes | Length of all buffers to be sent. Will be used as a boundary for the previous parameter. It must not exceed the sendBufferSize fed to this class during construction. |
destination_locators_begin | First iterator of the list of Locators describing the remote destinations we're sending to. |
destination_locators_end | End iterator of the list of Locators describing the remote destinations we're sending to. |
timeout | Maximum blocking time. |
|
inlineoverridevirtual |
Call the low-level transport transform_remote_locator()
.
Transforms a remote locator into a locator optimized for local communications.
Reimplemented from TransportInterface.
|
inlineoverridevirtual |
Call the low-level transport transform_remote_locator()
.
Transforms a remote locator into a locator optimized for local communications, if allowed by both local and remote transports.
Reimplemented from TransportInterface.
|
inlineoverridevirtual |
Update network interfaces.
Reimplemented from TransportInterface.
|
protected |