OpenDDS
Snapshot(2023/04/07-19:43)
|
#include <RtpsUdpSendStrategy.h>
Classes | |
struct | Chunk |
struct | OverrideToken |
Public Member Functions | |
RtpsUdpSendStrategy (RtpsUdpDataLink *link, const GuidPrefix_t &local_prefix) | |
virtual void | stop_i () |
Let the subclass stop. More... | |
OverrideToken | override_destinations (const NetworkAddress &destination) |
OverrideToken | override_destinations (const AddrSet &destinations) |
void | send_rtps_control (RTPS::Message &message, ACE_Message_Block &submessages, const NetworkAddress &destination) |
void | send_rtps_control (RTPS::Message &message, ACE_Message_Block &submessages, const AddrSet &destinations) |
void | append_submessages (const RTPS::SubmessageSeq &submessages) |
void | encode_payload (const GUID_t &pub_id, Message_Block_Ptr &payload, RTPS::SubmessageSeq &submessages) |
virtual Security::SecurityConfig_rch | security_config () const |
![]() | |
virtual | ~TransportSendStrategy () |
void | send_buffer (TransportSendBuffer *send_buffer) |
Assigns an optional send buffer. More... | |
int | start () |
void | stop () |
void | send_start () |
void | send (TransportQueueElement *element, bool relink=true) |
void | send_stop (GUID_t repoId) |
RemoveResult | remove_sample (const DataSampleElement *sample) |
void | remove_all_msgs (const GUID_t &pub_id) |
virtual WorkOutcome | perform_work () |
virtual void | relink (bool do_suspend=true) |
void | suspend_send () |
void | resume_send () |
void | terminate_send (bool graceful_disconnecting=false) |
Remove all samples in the backpressure queue and packet queue. More... | |
virtual void | terminate_send_if_suspended () |
virtual bool | start_i () |
Let the subclass start. More... | |
void | link_released (bool flag) |
bool | isDirectMode () |
virtual ACE_HANDLE | get_handle () |
void | deliver_ack_request (TransportQueueElement *element) |
bool | fragmentation_helper (TransportQueueElement *original_element, TqeVector &elements_to_send) |
void | clear (SendMode new_mode, SendMode old_mode=MODE_NOT_SET) |
SendMode | mode () const |
Access the current sending mode. More... | |
![]() | |
virtual | ~ThreadSynchWorker () |
virtual void | schedule_output () |
Indicate that queued data is available to be sent. More... | |
std::size_t | id () const |
DataLink reference value for diagnostics. More... | |
![]() | |
virtual | ~RcObject () |
virtual void | _add_ref () |
virtual void | _remove_ref () |
long | ref_count () const |
WeakObject * | _get_weak_object () const |
Static Public Attributes | |
static const size_t | MaxCryptoHeaderSize = 20 |
static const size_t | MaxCryptoFooterSize = 20 |
static const size_t | MaxSecurePrefixSize = RTPS::SMHDR_SZ + MaxCryptoHeaderSize |
static const size_t | MaxSubmessagePadding = RTPS::SM_ALIGN - 1 |
static const size_t | MaxSecureSuffixSize = RTPS::SMHDR_SZ + MaxCryptoFooterSize |
static const size_t | MaxSecureSubmessageLeadingSize = MaxSecurePrefixSize |
static const size_t | MaxSecureSubmessageFollowingSize |
static const size_t | MaxSecureSubmessageAdditionalSize |
static const size_t | MaxSecureFullMessageLeadingSize |
static const size_t | MaxSecureFullMessageFollowingSize = MaxSecureSuffixSize |
static const size_t | MaxSecureFullMessageAdditionalSize |
![]() | |
static const size_t | UDP_MAX_MESSAGE_SIZE = 65466 |
Protected Member Functions | |
virtual ssize_t | send_bytes_i (const iovec iov[], int n) |
ssize_t | send_bytes_i_helper (const iovec iov[], int n) |
virtual size_t | max_message_size () const |
virtual void | add_delayed_notification (TransportQueueElement *element) |
![]() | |
TransportSendStrategy (std::size_t id, const TransportImpl_rch &transport, ThreadSynchResource *synch_resource, Priority priority, const ThreadSynchStrategy_rch &thread_sync_strategy) | |
virtual ssize_t | send_bytes (const iovec iov[], int n, int &bp) |
virtual ssize_t | non_blocking_send (const iovec iov[], int n, int &bp) |
virtual void | prepare_header_i () |
Specific implementation processing of prepared packet header. More... | |
virtual void | prepare_packet_i () |
Specific implementation processing of prepared packet. More... | |
TransportQueueElement * | current_packet_first_element () const |
void | set_graceful_disconnecting (bool flag) |
Set graceful disconnecting flag. More... | |
bool | send_delayed_notifications (const TransportQueueElement::MatchCriteria *match=0) |
virtual RemoveResult | do_remove_sample (const GUID_t &pub_id, const TransportQueueElement::MatchCriteria &criteria, bool remove_all=false) |
Implement framework chain visitations to remove a sample. More... | |
ThreadSynch * | synch () const |
void | set_header_source (ACE_INT64 source) |
![]() | |
ThreadSynchWorker (std::size_t id=0) | |
![]() | |
RcObject () | |
Private Attributes | |
RtpsUdpDataLink * | link_ |
const AddrSet * | override_dest_ |
const NetworkAddress * | override_single_dest_ |
const size_t | max_message_size_ |
RTPS::Message | rtps_message_ |
ACE_Thread_Mutex | rtps_message_mutex_ |
char | rtps_header_data_ [RTPS::RTPSHDR_SZ] |
ACE_Data_Block | rtps_header_db_ |
ACE_Message_Block | rtps_header_mb_ |
ACE_Thread_Mutex | rtps_header_mb_lock_ |
AtomicBool | network_is_unreachable_ |
Friends | |
struct | OverrideToken |
Additional Inherited Members | |
![]() | |
enum | SendMode { MODE_NOT_SET, MODE_DIRECT, MODE_QUEUE, MODE_SUSPEND, MODE_TERMINATED } |
typedef BasicQueue< TransportQueueElement > | QueueType |
![]() | |
enum | WorkOutcome { WORK_OUTCOME_MORE_TO_DO, WORK_OUTCOME_NO_MORE_TO_DO, WORK_OUTCOME_CLOGGED_RESOURCE, WORK_OUTCOME_BROKEN_RESOURCE } |
![]() | |
static int | mb_to_iov (const ACE_Message_Block &msg, iovec *iov) |
Definition at line 30 of file RtpsUdpSendStrategy.h.
OpenDDS::DCPS::RtpsUdpSendStrategy::RtpsUdpSendStrategy | ( | RtpsUdpDataLink * | link, |
const GuidPrefix_t & | local_prefix | ||
) |
Definition at line 34 of file RtpsUdpSendStrategy.cpp.
References code, EADDRNOTAVAIL, ENETUNREACH, ENOBUFS, EPERM, OpenDDS::RTPS::Header::guidPrefix, OpenDDS::RTPS::Message::hdr, OpenDDS::RTPS::Header::prefix, OpenDDS::RTPS::PROTOCOL_RTPS, OpenDDS::RTPS::PROTOCOLVERSION, rtps_header_mb_, rtps_message_, OpenDDS::RTPS::Header::vendorId, OpenDDS::RTPS::VENDORID_OPENDDS, and OpenDDS::RTPS::Header::version.
|
protectedvirtual |
Reimplemented from OpenDDS::DCPS::TransportSendStrategy.
Definition at line 356 of file RtpsUdpSendStrategy.cpp.
References OpenDDS::DCPS::RtpsUdpDataLink::add_delayed_notification(), OpenDDS::DCPS::TransportSendStrategy::add_delayed_notification(), ACE_Message_Block::cont(), ACE_Message_Block::length(), link_, ACE_Message_Block::rd_ptr(), and ACE_Message_Block::total_length().
void OpenDDS::DCPS::RtpsUdpSendStrategy::append_submessages | ( | const RTPS::SubmessageSeq & | submessages | ) |
Definition at line 241 of file RtpsUdpSendStrategy.cpp.
References ACE_GUARD, OpenDDS::DCPS::push_back(), rtps_message_, rtps_message_mutex_, and OpenDDS::RTPS::Message::submessages.
|
private |
Definition at line 268 of file RtpsUdpSendStrategy.cpp.
References OpenDDS::DCPS::NetworkAddress::get_type(), link_, and OpenDDS::DCPS::RtpsUdpDataLink::unicast_socket().
Referenced by send_single_i().
void OpenDDS::DCPS::RtpsUdpSendStrategy::encode_payload | ( | const GUID_t & | pub_id, |
Message_Block_Ptr & | payload, | ||
RTPS::SubmessageSeq & | submessages | ||
) |
Definition at line 385 of file RtpsUdpSendStrategy.cpp.
References ACE_CDR_BYTE_ORDER, ACE_Message_Block::copy(), OpenDDS::RTPS::DATA, OpenDDS::RTPS::FLAG_N_IN_DATA, OpenDDS::RTPS::FLAG_Q, OpenDDS::RTPS::SubmessageHeader::flags, OpenDDS::DCPS::unique_ptr< T, Deleter >::get(), DDS::HANDLE_NIL, OpenDDS::DCPS::RtpsUdpDataLink::handle_registry(), OpenDDS::RTPS::DataSubmessage::inlineQos, OpenDDS::DCPS::Encoding::KIND_XCDR1, link_, LM_WARNING, OpenDDS::DCPS::unique_ptr< T, Deleter >::reset(), OpenDDS::DCPS::RtpsUdpDataLink::security_config(), OpenDDS::RTPS::DataSubmessage::smHeader, and VDBG_LVL.
|
private |
Definition at line 590 of file RtpsUdpSendStrategy.cpp.
References DDS::Security::CryptoTransform::encode_datareader_submessage(), OpenDDS::DCPS::RtpsUdpSendStrategy::Chunk::encoded_, OpenDDS::DCPS::GUID_UNKNOWN, DDS::HANDLE_NIL, OpenDDS::DCPS::RtpsUdpDataLink::handle_registry(), OpenDDS::DCPS::RtpsUdpSendStrategy::Chunk::length_, link_, and OpenDDS::DCPS::RtpsUdpSendStrategy::Chunk::start_.
Referenced by encode_submessages().
|
private |
Definition at line 470 of file RtpsUdpSendStrategy.cpp.
References ACE_ERROR, DDS::Security::SecurityException::code, ACE_Message_Block::copy(), OpenDDS::RTPS::DATA, OpenDDS::RTPS::DATA_FRAG, ACE_Message_Block::duplicate(), DDS::Security::CryptoTransform::encode_rtps_message(), OpenDDS::DCPS::Serializer::encoding(), OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER, OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER, OpenDDS::RTPS::SubmessageHeader::flags, OpenDDS::RTPS::INFO_TS, link_, LM_ERROR, OpenDDS::DCPS::RtpsUdpDataLink::local_crypto_handle(), DDS::Security::SecurityException::message, DDS::Security::SecurityException::minor_code, OpenDDS::RTPS::PAD, OpenDDS::DCPS::Serializer::read_octet_array(), OpenDDS::DCPS::unique_ptr< T, Deleter >::release(), OpenDDS::RTPS::SMHDR_SZ, ACE_Message_Block::space(), OpenDDS::RTPS::SubmessageHeader::submessageId, OpenDDS::RTPS::SubmessageHeader::submessageLength, OpenDDS::DCPS::Transport_debug_level, and ACE_Message_Block::wr_ptr().
Referenced by pre_send_packet().
|
private |
Definition at line 634 of file RtpsUdpSendStrategy.cpp.
References OpenDDS::RTPS::ACKNACK, OpenDDS::DCPS::assign(), OpenDDS::RTPS::MessageParser::current(), OpenDDS::RTPS::DATA, OpenDDS::RTPS::DATA_FRAG, ACE_Message_Block::duplicate(), encode_reader_submessage(), encode_writer_submessage(), OpenDDS::DCPS::GUID_t::entityId, OpenDDS::RTPS::GAP, OpenDDS::DCPS::GUID_UNKNOWN, OpenDDS::DCPS::GUID_t::guidPrefix, OpenDDS::DCPS::RtpsUdpDataLink::handle_registry(), OpenDDS::RTPS::MessageParser::hasNextSubmessage(), OpenDDS::RTPS::HEARTBEAT, OpenDDS::RTPS::HEARTBEAT_FRAG, OpenDDS::RTPS::INFO_DST, link_, OpenDDS::DCPS::RtpsUdpDataLink::local_prefix(), OpenDDS::RTPS::NACK_FRAG, OpenDDS::DCPS::TransportSendStrategy::OPENDDS_VECTOR(), OpenDDS::RTPS::MessageParser::parseHeader(), OpenDDS::RTPS::MessageParser::parseSubmessageHeader(), OpenDDS::RTPS::MessageParser::remaining(), replace_chunks(), OpenDDS::RTPS::MessageParser::serializer(), OpenDDS::RTPS::MessageParser::skipToNextSubmessage(), OpenDDS::RTPS::MessageParser::submessageHeader(), and OpenDDS::RTPS::SubmessageHeader::submessageId.
Referenced by pre_send_packet().
|
private |
Definition at line 545 of file RtpsUdpSendStrategy.cpp.
References DDS::Security::CryptoTransform::encode_datawriter_submessage(), OpenDDS::DCPS::RtpsUdpSendStrategy::Chunk::encoded_, OpenDDS::DCPS::GUID_UNKNOWN, DDS::HANDLE_NIL, OpenDDS::DCPS::RtpsUdpDataLink::handle_registry(), OpenDDS::DCPS::RtpsUdpSendStrategy::Chunk::length_, link_, and OpenDDS::DCPS::RtpsUdpSendStrategy::Chunk::start_.
Referenced by encode_submessages().
|
privatevirtual |
Reimplemented from OpenDDS::DCPS::TransportSendStrategy.
Definition at line 143 of file RtpsUdpSendStrategy.cpp.
References ACE_Message_Block::cont(), head_, OpenDDS::DCPS::TransportSendStrategy::lock_, rtps_header_data_, OpenDDS::RTPS::RTPSHDR_SZ, and OpenDDS::DCPS::Serializer::write_octet_array().
|
protectedvirtual |
The maximum size of a message allowed by the this TransportImpl, or 0 if there is no such limit. This is expected to be a constant, for example UDP/IPv4 can send messages of up to 65466 bytes. The transport framework will use the returned value (if > 0) to fragment larger messages. This fragmentation and reassembly will be transparent to the user.
Reimplemented from OpenDDS::DCPS::TransportSendStrategy.
Definition at line 799 of file RtpsUdpSendStrategy.cpp.
References max_message_size_, MaxSecureFullMessageAdditionalSize, MaxSecureSubmessageAdditionalSize, and OPENDDS_END_VERSIONED_NAMESPACE_DECL.
RtpsUdpSendStrategy::OverrideToken OpenDDS::DCPS::RtpsUdpSendStrategy::override_destinations | ( | const NetworkAddress & | destination | ) |
Definition at line 123 of file RtpsUdpSendStrategy.cpp.
References override_single_dest_, and OverrideToken.
RtpsUdpSendStrategy::OverrideToken OpenDDS::DCPS::RtpsUdpSendStrategy::override_destinations | ( | const AddrSet & | destinations | ) |
Definition at line 130 of file RtpsUdpSendStrategy.cpp.
References override_dest_, and OverrideToken.
|
privatevirtual |
Derived classes can override to transform the data right before it's sent. If the returned value is non-NULL it will be sent instead of sending the parameter. If the returned value is NULL the original message will be dropped.
Reimplemented from OpenDDS::DCPS::TransportSendStrategy.
Definition at line 452 of file RtpsUdpSendStrategy.cpp.
References ACE_Message_Block::duplicate(), encode_rtps_message(), encode_submessages(), OpenDDS::DCPS::unique_ptr< T, Deleter >::get(), DDS::HANDLE_NIL, link_, OpenDDS::DCPS::RtpsUdpDataLink::local_crypto_handle(), OpenDDS::DCPS::unique_ptr< T, Deleter >::release(), and OpenDDS::DCPS::RtpsUdpDataLink::security_config().
Referenced by send_rtps_control().
|
private |
Definition at line 749 of file RtpsUdpSendStrategy.cpp.
References ACE_Message_Block::copy(), ACE_Message_Block::duplicate(), OpenDDS::DCPS::RtpsUdpSendStrategy::Chunk::encoded_, OpenDDS::DCPS::RtpsUdpSendStrategy::Chunk::length_, OpenDDS::DCPS::unique_ptr< T, Deleter >::release(), OpenDDS::DCPS::RtpsUdpSendStrategy::Chunk::start_, and ACE_Message_Block::total_length().
Referenced by encode_submessages().
|
virtual |
Reimplemented from OpenDDS::DCPS::TransportSendStrategy.
Definition at line 379 of file RtpsUdpSendStrategy.cpp.
References link_, and OpenDDS::DCPS::RtpsUdpDataLink::security_config().
Referenced by send_rtps_control().
|
protectedvirtual |
Implements OpenDDS::DCPS::TransportSendStrategy.
Definition at line 67 of file RtpsUdpSendStrategy.cpp.
References send_bytes_i_helper().
|
protected |
Definition at line 86 of file RtpsUdpSendStrategy.cpp.
References OpenDDS::DCPS::TransportSendStrategy::current_packet_first_element(), ENOTCONN, OpenDDS::DCPS::RtpsUdpDataLink::get_addresses(), OpenDDS::DCPS::GUID_UNKNOWN, link_, override_dest_, override_single_dest_, OpenDDS::DCPS::TransportQueueElement::publication_id(), send_multi_i(), send_single_i(), and OpenDDS::DCPS::TransportQueueElement::subscription_id().
Referenced by send_bytes_i().
|
private |
Definition at line 250 of file RtpsUdpSendStrategy.cpp.
References send_single_i().
Referenced by send_bytes_i_helper(), and send_rtps_control().
void OpenDDS::DCPS::RtpsUdpSendStrategy::send_rtps_control | ( | RTPS::Message & | message, |
ACE_Message_Block & | submessages, | ||
const NetworkAddress & | destination | ||
) |
Definition at line 161 of file RtpsUdpSendStrategy.cpp.
References ACE_ERROR, ACE_GUARD, OpenDDS::RTPS::Message::hdr, link_, LM_DEBUG, LM_ERROR, LM_WARNING, OpenDDS::DCPS::MAX_SEND_BLOCKS, OpenDDS::DCPS::TransportSendStrategy::mb_to_iov(), network_is_unreachable_, pre_send_packet(), OpenDDS::DCPS::unique_ptr< T, Deleter >::reset(), rtps_header_mb_, rtps_header_mb_lock_, rtps_message_, rtps_message_mutex_, security_config(), OpenDDS::DCPS::RtpsUdpDataLink::security_config(), send_single_i(), and VDBG.
void OpenDDS::DCPS::RtpsUdpSendStrategy::send_rtps_control | ( | RTPS::Message & | message, |
ACE_Message_Block & | submessages, | ||
const AddrSet & | destinations | ||
) |
Definition at line 201 of file RtpsUdpSendStrategy.cpp.
References ACE_ERROR, ACE_GUARD, OpenDDS::RTPS::Message::hdr, link_, LM_DEBUG, LM_ERROR, LM_WARNING, OpenDDS::DCPS::MAX_SEND_BLOCKS, OpenDDS::DCPS::TransportSendStrategy::mb_to_iov(), network_is_unreachable_, pre_send_packet(), OpenDDS::DCPS::unique_ptr< T, Deleter >::reset(), rtps_header_mb_, rtps_header_mb_lock_, rtps_message_, rtps_message_mutex_, security_config(), OpenDDS::DCPS::RtpsUdpDataLink::security_config(), send_multi_i(), and VDBG.
|
private |
Definition at line 280 of file RtpsUdpSendStrategy.cpp.
References ACE_ERROR, ACE_GUARD_RETURN, choose_send_socket(), EMSGSIZE, ENETUNREACH, link_, LM_ERROR, LM_WARNING, OpenDDS::DCPS::MCK_RTPS, network_is_unreachable_, OPENDDS_ASSERT, ACE_SOCK_Dgram::send(), socket(), OpenDDS::DCPS::NetworkAddress::to_addr(), OpenDDS::DCPS::RtpsUdpDataLink::transport(), and OpenDDS::DCPS::TransportSendStrategy::UDP_MAX_MESSAGE_SIZE.
Referenced by send_bytes_i_helper(), send_multi_i(), and send_rtps_control().
|
virtual |
Let the subclass stop.
Implements OpenDDS::DCPS::TransportSendStrategy.
Definition at line 795 of file RtpsUdpSendStrategy.cpp.
|
friend |
Definition at line 43 of file RtpsUdpSendStrategy.h.
Referenced by override_destinations().
|
private |
Definition at line 135 of file RtpsUdpSendStrategy.h.
Referenced by add_delayed_notification(), choose_send_socket(), encode_payload(), encode_reader_submessage(), encode_rtps_message(), encode_submessages(), encode_writer_submessage(), pre_send_packet(), security_config(), send_bytes_i_helper(), send_rtps_control(), and send_single_i().
|
private |
Definition at line 139 of file RtpsUdpSendStrategy.h.
Referenced by max_message_size().
|
static |
Definition at line 64 of file RtpsUdpSendStrategy.h.
|
static |
Definition at line 63 of file RtpsUdpSendStrategy.h.
|
static |
Definition at line 76 of file RtpsUdpSendStrategy.h.
Referenced by max_message_size().
|
static |
Definition at line 75 of file RtpsUdpSendStrategy.h.
|
static |
Definition at line 73 of file RtpsUdpSendStrategy.h.
|
static |
Definition at line 65 of file RtpsUdpSendStrategy.h.
|
static |
Definition at line 71 of file RtpsUdpSendStrategy.h.
Referenced by max_message_size().
|
static |
Definition at line 69 of file RtpsUdpSendStrategy.h.
|
static |
Definition at line 68 of file RtpsUdpSendStrategy.h.
|
static |
Definition at line 67 of file RtpsUdpSendStrategy.h.
|
static |
Definition at line 66 of file RtpsUdpSendStrategy.h.
|
private |
Definition at line 146 of file RtpsUdpSendStrategy.h.
Referenced by send_rtps_control(), and send_single_i().
|
private |
Definition at line 136 of file RtpsUdpSendStrategy.h.
Referenced by override_destinations(), and send_bytes_i_helper().
|
private |
Definition at line 137 of file RtpsUdpSendStrategy.h.
Referenced by override_destinations(), and send_bytes_i_helper().
|
private |
Definition at line 142 of file RtpsUdpSendStrategy.h.
Referenced by marshal_transport_header().
|
private |
Definition at line 143 of file RtpsUdpSendStrategy.h.
|
private |
Definition at line 144 of file RtpsUdpSendStrategy.h.
Referenced by RtpsUdpSendStrategy(), and send_rtps_control().
|
private |
Definition at line 145 of file RtpsUdpSendStrategy.h.
Referenced by send_rtps_control().
|
private |
Definition at line 140 of file RtpsUdpSendStrategy.h.
Referenced by append_submessages(), RtpsUdpSendStrategy(), and send_rtps_control().
|
private |
Definition at line 141 of file RtpsUdpSendStrategy.h.
Referenced by append_submessages(), and send_rtps_control().