OpenDDS
Snapshot(2023/04/07-19:43)
|
Base class to hold configuration settings for TransportImpls. More...
#include <TransportInst.h>
Public Member Functions | |
const OPENDDS_STRING & | name () const |
virtual int | load (ACE_Configuration_Heap &cf, ACE_Configuration_Section_Key §) |
void | dump () const |
Diagnostic aid. More... | |
virtual OPENDDS_STRING | dump_to_str () const |
virtual bool | is_reliable () const =0 |
Does the transport as configured support RELIABLE_RELIABILITY_QOS? More... | |
virtual bool | requires_cdr_encapsulation () const |
Does the transport require a CDR-encapsulated data payload? More... | |
virtual size_t | populate_locator (OpenDDS::DCPS::TransportLocator &trans_info, ConnectionInfoFlags flags) const =0 |
Populate a transport locator sequence. Return the number of "locators.". More... | |
DCPS::WeakRcHandle< ICE::Endpoint > | get_ice_endpoint () |
void | rtps_relay_only_now (bool flag) |
void | use_rtps_relay_now (bool flag) |
void | use_ice_now (bool flag) |
virtual void | update_locators (const GUID_t &, const TransportLocatorSeq &) |
virtual void | get_last_recv_locator (const GUID_t &, TransportLocator &) |
virtual void | rtps_relay_address_change () |
ReactorTask_rch | reactor_task () |
EventDispatcher_rch | event_dispatcher () |
void | count_messages (bool flag) |
bool | count_messages () const |
virtual void | append_transport_statistics (TransportStatisticsSequence &) |
void | drop_messages (bool flag) |
void | drop_messages_m (double m) |
void | drop_messages_b (double b) |
bool | should_drop (ssize_t length) const |
bool | should_drop (const iovec iov[], int n, ssize_t &length) const |
![]() | |
virtual | ~RcObject () |
virtual void | _add_ref () |
virtual void | _remove_ref () |
long | ref_count () const |
WeakObject * | _get_weak_object () const |
Static Public Member Functions | |
static OPENDDS_STRING | formatNameForDump (const char *name) |
Public Attributes | |
const OPENDDS_STRING | transport_type_ |
size_t | queue_messages_per_pool_ |
size_t | queue_initial_pools_ |
ACE_UINT32 | max_packet_size_ |
Max size (in bytes) of a packet (packet header + sample(s)) More... | |
size_t | max_samples_per_packet_ |
Max number of samples that should ever be in a single packet. More... | |
ACE_UINT32 | optimum_packet_size_ |
Optimum size (in bytes) of a packet (packet header + sample(s)). More... | |
bool | thread_per_connection_ |
long | datalink_release_delay_ |
size_t | datalink_control_chunks_ |
TimeDuration | fragment_reassembly_timeout_ |
size_t | receive_preallocated_message_blocks_ |
size_t | receive_preallocated_data_blocks_ |
Static Public Attributes | |
static const long | DEFAULT_DATALINK_RELEASE_DELAY = 10000 |
static const size_t | DEFAULT_DATALINK_CONTROL_CHUNKS = 32u |
Protected Member Functions | |
TransportInst (const char *type, const OPENDDS_STRING &name) | |
virtual | ~TransportInst () |
void | set_port_in_addr_string (OPENDDS_STRING &addr_str, u_short port_number) |
TransportImpl_rch | get_or_create_impl () |
TransportImpl_rch | get_impl () |
![]() | |
RcObject () | |
Protected Attributes | |
ACE_SYNCH_MUTEX | lock_ |
bool | shutting_down_ |
Private Member Functions | |
void | adjust_config_value () |
void | shutdown () |
virtual TransportImpl_rch | new_impl ()=0 |
Private Attributes | |
const OPENDDS_STRING | name_ |
TransportImpl_rch | impl_ |
bool | drop_messages_ |
double | drop_messages_m_ |
double | drop_messages_b_ |
bool | count_messages_ |
ACE_Thread_Mutex | config_lock_ |
Friends | |
class | TransportRegistry |
class | TransportClient |
Base class to hold configuration settings for TransportImpls.
Each transport implementation will need to define a concrete subclass of the TransportInst class. The base class (TransportInst) contains configuration settings that are common to all (or most) concrete transport implementations. The concrete transport implementation defines any configuration settings that it requires within its concrete subclass of this TransportInst base class.
The TransportInst object is supplied to the TransportImpl::configure() method.
Definition at line 64 of file TransportInst.h.
|
protected |
Definition at line 13 of file TransportInst.inl.
References ACE_INLINE, adjust_config_value(), and DBG_ENTRY_LVL.
|
protectedvirtual |
|
private |
Adjust the configuration values which gives warning on adjusted value.
Definition at line 40 of file TransportInst.inl.
References ACE_DEBUG, ACE_TEXT(), LM_NOTICE, max_samples_per_packet_, and OpenDDS::DCPS::MAX_SEND_BLOCKS.
Referenced by load(), and TransportInst().
|
inlinevirtual |
Reimplemented in OpenDDS::DCPS::RtpsUdpInst.
Definition at line 219 of file TransportInst.h.
References OPENDDS_STRING.
Referenced by OpenDDS::RTPS::Sedp::append_transport_statistics().
|
inline |
Definition at line 207 of file TransportInst.h.
References ACE_GUARD.
|
inline |
Definition at line 213 of file TransportInst.h.
References ACE_GUARD_RETURN.
|
inline |
The RtpsUdpSendStrategy can be configured to simulate a lossy connection by probabilistically not sending RTPS messages. This capability is enabled by setting the flag to true.
The coefficients m and b correspond to a linear model whose argument is the length of the RTPS message. The probablility of dropping the message is p = m * message_length + b. When sending a message, a random number is selected from [0.0, 1.0]. If the random number is less than the drop probability, the message is dropped.
The flag and coefficient can be changed dynamically.
Examples
m = 0 and b = .5 - the probability of dropping a message is .5 regardless of message length.
m = .001 and b = .2 - the probability of dropping a 200-byte message is .4. In this example, all messages longer than 800 bytes will be dropped.
Definition at line 177 of file TransportInst.h.
References ACE_GUARD.
|
inline |
The RtpsUdpSendStrategy can be configured to simulate a lossy connection by probabilistically not sending RTPS messages. This capability is enabled by setting the flag to true.
The coefficients m and b correspond to a linear model whose argument is the length of the RTPS message. The probablility of dropping the message is p = m * message_length + b. When sending a message, a random number is selected from [0.0, 1.0]. If the random number is less than the drop probability, the message is dropped.
The flag and coefficient can be changed dynamically.
Examples
m = 0 and b = .5 - the probability of dropping a message is .5 regardless of message length.
m = .001 and b = .2 - the probability of dropping a 200-byte message is .4. In this example, all messages longer than 800 bytes will be dropped.
Definition at line 189 of file TransportInst.h.
References ACE_GUARD.
|
inline |
The RtpsUdpSendStrategy can be configured to simulate a lossy connection by probabilistically not sending RTPS messages. This capability is enabled by setting the flag to true.
The coefficients m and b correspond to a linear model whose argument is the length of the RTPS message. The probablility of dropping the message is p = m * message_length + b. When sending a message, a random number is selected from [0.0, 1.0]. If the random number is less than the drop probability, the message is dropped.
The flag and coefficient can be changed dynamically.
Examples
m = 0 and b = .5 - the probability of dropping a message is .5 regardless of message length.
m = .001 and b = .2 - the probability of dropping a 200-byte message is .4. In this example, all messages longer than 800 bytes will be dropped.
Definition at line 183 of file TransportInst.h.
References ACE_GUARD.
void OpenDDS::DCPS::TransportInst::dump | ( | void | ) | const |
Diagnostic aid.
Definition at line 74 of file TransportInst.cpp.
References ACE_DEBUG, ACE_TEXT(), dump_to_str(), LM_DEBUG, and OPENDDS_STRING.
|
virtual |
Reimplemented in OpenDDS::DCPS::MulticastInst, OpenDDS::DCPS::RtpsUdpInst, OpenDDS::DCPS::TcpInst, OpenDDS::DCPS::UdpInst, and OpenDDS::DCPS::ShmemInst.
Definition at line 101 of file TransportInst.cpp.
References datalink_control_chunks_, datalink_release_delay_, formatNameForDump(), fragment_reassembly_timeout_, max_packet_size_, max_samples_per_packet_, name_, OPENDDS_STRING, optimum_packet_size_, queue_initial_pools_, queue_messages_per_pool_, receive_preallocated_data_blocks_, receive_preallocated_message_blocks_, OpenDDS::DCPS::TimeDuration::str(), thread_per_connection_, OpenDDS::DCPS::to_dds_string(), and transport_type_.
Referenced by dump(), OpenDDS::DCPS::ShmemInst::dump_to_str(), OpenDDS::DCPS::UdpInst::dump_to_str(), OpenDDS::DCPS::TcpInst::dump_to_str(), OpenDDS::DCPS::RtpsUdpInst::dump_to_str(), OpenDDS::DCPS::MulticastInst::dump_to_str(), and OpenDDS::DCPS::TransportImpl::dump_to_str().
OpenDDS::DCPS::EventDispatcher_rch OpenDDS::DCPS::TransportInst::event_dispatcher | ( | ) |
Definition at line 223 of file TransportInst.cpp.
References OpenDDS::DCPS::TransportImpl::event_dispatcher(), and get_or_create_impl().
Referenced by OpenDDS::RTPS::Sedp::init().
|
static |
Format name of transport configuration parameter for use in conjunction with dump(std::ostream& os).
Definition at line 87 of file TransportInst.cpp.
References name(), and OPENDDS_STRING.
Referenced by OpenDDS::DCPS::ShmemInst::dump_to_str(), OpenDDS::DCPS::UdpInst::dump_to_str(), OpenDDS::DCPS::TcpInst::dump_to_str(), OpenDDS::DCPS::RtpsUdpInst::dump_to_str(), dump_to_str(), and OpenDDS::DCPS::MulticastInst::dump_to_str().
OpenDDS::DCPS::WeakRcHandle< OpenDDS::ICE::Endpoint > OpenDDS::DCPS::TransportInst::get_ice_endpoint | ( | ) |
Definition at line 182 of file TransportInst.cpp.
References OpenDDS::DCPS::TransportImpl::get_ice_endpoint(), and get_or_create_impl().
Referenced by OpenDDS::RTPS::Sedp::get_ice_endpoint().
|
protected |
Definition at line 149 of file TransportInst.cpp.
References ACE_GUARD_RETURN, ACE_SYNCH_MUTEX, impl_, and lock_.
Referenced by OpenDDS::DCPS::RtpsUdpInst::rtps_relay_address_change().
|
inlinevirtual |
Reimplemented in OpenDDS::DCPS::RtpsUdpInst.
Definition at line 145 of file TransportInst.h.
Referenced by OpenDDS::RTPS::Sedp::populate_origination_locator().
|
protected |
Definition at line 135 of file TransportInst.cpp.
References ACE_GUARD_RETURN, ACE_SYNCH_MUTEX, impl_, lock_, new_impl(), and shutting_down_.
Referenced by OpenDDS::DCPS::RtpsUdpInst::append_transport_statistics(), OpenDDS::DCPS::TransportClient::enable_transport_using_config(), event_dispatcher(), get_ice_endpoint(), OpenDDS::DCPS::RtpsUdpInst::get_last_recv_locator(), OpenDDS::DCPS::TransportClient::populate_connection_info(), reactor_task(), rtps_relay_only_now(), OpenDDS::DCPS::RtpsUdpInst::update_locators(), use_ice_now(), and use_rtps_relay_now().
|
pure virtual |
Does the transport as configured support RELIABLE_RELIABILITY_QOS?
Implemented in OpenDDS::DCPS::MulticastInst, OpenDDS::DCPS::TcpInst, OpenDDS::DCPS::RtpsUdpInst, OpenDDS::DCPS::ShmemInst, and OpenDDS::DCPS::UdpInst.
Referenced by OpenDDS::DCPS::RecorderImpl::check_transport_qos(), and OpenDDS::DCPS::DataReaderImpl::check_transport_qos().
|
virtual |
Overwrite the default configurations with the configuration from the given section in the ACE_Configuration_Heap object.
Reimplemented in OpenDDS::DCPS::MulticastInst, OpenDDS::DCPS::RtpsUdpInst, OpenDDS::DCPS::TcpInst, OpenDDS::DCPS::UdpInst, and OpenDDS::DCPS::ShmemInst.
Definition at line 41 of file TransportInst.cpp.
References ACE_DEBUG, ACE_TEXT(), adjust_config_value(), datalink_control_chunks_, datalink_release_delay_, fragment_reassembly_timeout_, GET_CONFIG_TIME_VALUE, GET_CONFIG_VALUE, ACE_Configuration_Heap::get_string_value(), LM_WARNING, max_packet_size_, max_samples_per_packet_, optimum_packet_size_, queue_initial_pools_, queue_messages_per_pool_, receive_preallocated_data_blocks_, receive_preallocated_message_blocks_, and thread_per_connection_.
Referenced by OpenDDS::DCPS::TransportRegistry::create_new_transport_instance_for_participant(), OpenDDS::DCPS::ShmemInst::load(), OpenDDS::DCPS::UdpInst::load(), OpenDDS::DCPS::TcpInst::load(), OpenDDS::DCPS::RtpsUdpInst::load(), and OpenDDS::DCPS::MulticastInst::load().
|
inline |
Definition at line 70 of file TransportInst.h.
References load, name, and OPENDDS_STRING.
Referenced by formatNameForDump(), OpenDDS::DCPS::TransportRegistry::remove_inst(), OpenDDS::DCPS::ShmemInst::ShmemInst(), and OpenDDS::DCPS::TransportConfig::sorted_insert().
|
privatepure virtual |
Implemented in OpenDDS::DCPS::RtpsUdpInst, OpenDDS::DCPS::TcpInst, OpenDDS::DCPS::MulticastInst, OpenDDS::DCPS::UdpInst, and OpenDDS::DCPS::ShmemInst.
Referenced by get_or_create_impl().
|
pure virtual |
Populate a transport locator sequence. Return the number of "locators.".
Implemented in OpenDDS::DCPS::MulticastInst, OpenDDS::DCPS::TcpInst, OpenDDS::DCPS::RtpsUdpInst, OpenDDS::DCPS::ShmemInst, and OpenDDS::DCPS::UdpInst.
Referenced by OpenDDS::RTPS::Sedp::multicast_locators(), and OpenDDS::RTPS::Sedp::unicast_locators().
OpenDDS::DCPS::ReactorTask_rch OpenDDS::DCPS::TransportInst::reactor_task | ( | ) |
Definition at line 216 of file TransportInst.cpp.
References get_or_create_impl(), and OpenDDS::DCPS::TransportImpl::reactor_task().
Referenced by OpenDDS::RTPS::Sedp::init().
|
inlinevirtual |
Does the transport require a CDR-encapsulated data payload?
Reimplemented in OpenDDS::DCPS::RtpsUdpInst.
Definition at line 132 of file TransportInst.h.
Referenced by OpenDDS::DCPS::TransportClient::enable_transport_using_config().
|
inlinevirtual |
void OpenDDS::DCPS::TransportInst::rtps_relay_only_now | ( | bool | flag | ) |
Definition at line 189 of file TransportInst.cpp.
References get_or_create_impl(), and OpenDDS::DCPS::TransportImpl::rtps_relay_only_now().
Referenced by OpenDDS::RTPS::Sedp::rtps_relay_only_now().
|
protected |
Definition at line 156 of file TransportInst.cpp.
References ACE_OS::snprintf().
bool OpenDDS::DCPS::TransportInst::should_drop | ( | ssize_t | length | ) | const |
The RtpsUdpSendStrategy can be configured to simulate a lossy connection by probabilistically not sending RTPS messages. This capability is enabled by setting the flag to true.
The coefficients m and b correspond to a linear model whose argument is the length of the RTPS message. The probablility of dropping the message is p = m * message_length + b. When sending a message, a random number is selected from [0.0, 1.0]. If the random number is less than the drop probability, the message is dropped.
The flag and coefficient can be changed dynamically.
Examples
m = 0 and b = .5 - the probability of dropping a message is .5 regardless of message length.
m = .001 and b = .2 - the probability of dropping a 200-byte message is .4. In this example, all messages longer than 800 bytes will be dropped.
Definition at line 230 of file TransportInst.cpp.
References ACE_ERROR, ACE_GUARD_RETURN, config_lock_, drop_messages_, drop_messages_b_, drop_messages_m_, LM_ERROR, and OPENDDS_END_VERSIONED_NAMESPACE_DECL.
|
inline |
The RtpsUdpSendStrategy can be configured to simulate a lossy connection by probabilistically not sending RTPS messages. This capability is enabled by setting the flag to true.
The coefficients m and b correspond to a linear model whose argument is the length of the RTPS message. The probablility of dropping the message is p = m * message_length + b. When sending a message, a random number is selected from [0.0, 1.0]. If the random number is less than the drop probability, the message is dropped.
The flag and coefficient can be changed dynamically.
Examples
m = 0 and b = .5 - the probability of dropping a message is .5 regardless of message length.
m = .001 and b = .2 - the probability of dropping a 200-byte message is .4. In this example, all messages longer than 800 bytes will be dropped.
Definition at line 197 of file TransportInst.h.
|
private |
Definition at line 121 of file TransportInst.cpp.
References ACE_GUARD, ACE_SYNCH_MUTEX, impl_, lock_, OpenDDS::DCPS::TransportImpl::shutdown(), shutting_down_, and OpenDDS::DCPS::RcHandle< T >::swap().
Referenced by OpenDDS::DCPS::TransportRegistry::remove_inst().
|
inlinevirtual |
Reimplemented in OpenDDS::DCPS::RtpsUdpInst.
Definition at line 142 of file TransportInst.h.
Referenced by OpenDDS::RTPS::Sedp::update_locators().
void OpenDDS::DCPS::TransportInst::use_ice_now | ( | bool | flag | ) |
Definition at line 207 of file TransportInst.cpp.
References get_or_create_impl(), and OpenDDS::DCPS::TransportImpl::use_ice_now().
Referenced by OpenDDS::RTPS::Sedp::use_ice_now().
void OpenDDS::DCPS::TransportInst::use_rtps_relay_now | ( | bool | flag | ) |
Definition at line 198 of file TransportInst.cpp.
References get_or_create_impl(), and OpenDDS::DCPS::TransportImpl::use_rtps_relay_now().
Referenced by OpenDDS::RTPS::Sedp::use_rtps_relay_now().
|
friend |
Definition at line 242 of file TransportInst.h.
|
friend |
Definition at line 239 of file TransportInst.h.
|
mutableprivate |
Definition at line 259 of file TransportInst.h.
Referenced by should_drop().
|
private |
Definition at line 257 of file TransportInst.h.
size_t OpenDDS::DCPS::TransportInst::datalink_control_chunks_ |
The number of chunks used to size allocators for transport control samples. The default value is 32.
Definition at line 114 of file TransportInst.h.
Referenced by OpenDDS::DCPS::DataLink::DataLink(), dump_to_str(), and load().
long OpenDDS::DCPS::TransportInst::datalink_release_delay_ |
Delay in milliseconds that the datalink should be released after all associations are removed. The default value is 10 seconds.
Definition at line 110 of file TransportInst.h.
Referenced by OpenDDS::DCPS::DataLink::DataLink(), dump_to_str(), TAO_DDS_DCPSInfo_i::init_transport(), and load().
|
static |
Definition at line 68 of file TransportInst.h.
Referenced by OpenDDS::DCPS::DataLink::DataLink().
|
static |
Definition at line 67 of file TransportInst.h.
Referenced by OpenDDS::DCPS::DataLink::DataLink().
|
private |
Definition at line 253 of file TransportInst.h.
Referenced by should_drop().
|
private |
Definition at line 255 of file TransportInst.h.
Referenced by should_drop().
|
private |
Definition at line 254 of file TransportInst.h.
Referenced by should_drop().
TimeDuration OpenDDS::DCPS::TransportInst::fragment_reassembly_timeout_ |
Maximum time to store incoming fragments of incomplete data samples. The expiration time is relative to the last received fragment.
Definition at line 118 of file TransportInst.h.
Referenced by dump_to_str(), and load().
|
private |
Definition at line 251 of file TransportInst.h.
Referenced by get_impl(), get_or_create_impl(), and shutdown().
|
mutableprotected |
Definition at line 230 of file TransportInst.h.
Referenced by get_impl(), get_or_create_impl(), and shutdown().
ACE_UINT32 OpenDDS::DCPS::TransportInst::max_packet_size_ |
Max size (in bytes) of a packet (packet header + sample(s))
Definition at line 96 of file TransportInst.h.
Referenced by dump_to_str(), load(), and OpenDDS::DCPS::TransportSendStrategy::TransportSendStrategy().
size_t OpenDDS::DCPS::TransportInst::max_samples_per_packet_ |
Max number of samples that should ever be in a single packet.
Definition at line 99 of file TransportInst.h.
Referenced by adjust_config_value(), dump_to_str(), load(), and OpenDDS::DCPS::TransportSendStrategy::TransportSendStrategy().
|
private |
Definition at line 249 of file TransportInst.h.
Referenced by dump_to_str().
ACE_UINT32 OpenDDS::DCPS::TransportInst::optimum_packet_size_ |
Optimum size (in bytes) of a packet (packet header + sample(s)).
Definition at line 102 of file TransportInst.h.
Referenced by dump_to_str(), load(), and OpenDDS::DCPS::TransportSendStrategy::TransportSendStrategy().
size_t OpenDDS::DCPS::TransportInst::queue_initial_pools_ |
Initial number of pre-allocated pools of link (list) objects for the "send queue" of each DataLink.
Definition at line 93 of file TransportInst.h.
Referenced by dump_to_str(), and load().
size_t OpenDDS::DCPS::TransportInst::queue_messages_per_pool_ |
Number of pre-created link (list) objects per pool for the "send queue" of each DataLink.
Definition at line 89 of file TransportInst.h.
Referenced by dump_to_str(), and load().
size_t OpenDDS::DCPS::TransportInst::receive_preallocated_data_blocks_ |
Preallocated chunks in allocator for data blocks and data buffers. Default (0) is to use built-in constants in TransportReceiveStrategy
Definition at line 126 of file TransportInst.h.
Referenced by dump_to_str(), and load().
size_t OpenDDS::DCPS::TransportInst::receive_preallocated_message_blocks_ |
Preallocated chunks in allocator for message blocks. Default (0) is to use built-in constants in TransportReceiveStrategy
Definition at line 122 of file TransportInst.h.
Referenced by dump_to_str(), and load().
|
protected |
Definition at line 231 of file TransportInst.h.
Referenced by get_or_create_impl(), and shutdown().
bool OpenDDS::DCPS::TransportInst::thread_per_connection_ |
Flag for whether a new thread is needed for connection to send without backpressure.
Definition at line 106 of file TransportInst.h.
Referenced by OpenDDS::DCPS::DataLink::DataLink(), dump_to_str(), and load().
const OPENDDS_STRING OpenDDS::DCPS::TransportInst::transport_type_ |
Definition at line 85 of file TransportInst.h.
Referenced by dump_to_str().