OpenDDS
Snapshot(2023/04/07-19:43)
|
#include <TcpDataLink.h>
Protected Member Functions | |
virtual void | stop_i () |
virtual void | send_i (TransportQueueElement *element, bool relink=true) |
virtual void | send_stop_i (GUID_t repoId) |
![]() | |
int | start (const TransportSendStrategy_rch &send_strategy, const TransportStrategy_rch &receive_strategy, bool invoke_all=true) |
void | send_start_i () |
void | send_stop_i (GUID_t repoId) |
GUIDSeq * | peer_ids (const GUID_t &local_id) const |
void | network_change () const |
void | replay_durable_data (const GUID_t &local_pub_id, const GUID_t &remote_sub_id) const |
TransportSendStrategy_rch | get_send_strategy () |
typedef | OPENDDS_MAP_CMP (GUID_t, TransportClient_wrch, GUID_tKeyLessThan) RepoToClientMap |
typedef | OPENDDS_MAP_CMP (GUID_t, RepoToClientMap, GUID_tKeyLessThan) OnStartCallbackMap |
typedef | OPENDDS_MAP_CMP (GUID_t, RepoIdSet, GUID_tKeyLessThan) PendingOnStartsMap |
![]() | |
ACE_Event_Handler (ACE_Reactor *=0, int priority=ACE_Event_Handler::LO_PRIORITY) | |
![]() | |
RcObject () | |
Private Member Functions | |
bool | handle_send_request_ack (TransportQueueElement *element) |
void | send_graceful_disconnect_message () |
void | send_association_msg (const GUID_t &local, const GUID_t &remote) |
typedef | OPENDDS_VECTOR (TransportQueueElement *) PendingRequestAcks |
typedef | OPENDDS_SET_CMP (GUID_t, GUID_tKeyLessThan) RepoIdSetType |
Private Attributes | |
ACE_INET_Addr | remote_address_ |
WeakRcHandle< TcpConnection > | connection_ |
bool | graceful_disconnect_sent_ |
AtomicBool | release_is_pending_ |
ACE_SYNCH_MUTEX | pending_request_acks_lock_ |
PendingRequestAcks | pending_request_acks_ |
RepoIdSetType | stopped_clients_ |
ACE_Thread_Mutex | stopped_clients_mutex_ |
Definition at line 25 of file TcpDataLink.h.
OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL OpenDDS::DCPS::TcpDataLink::TcpDataLink | ( | const TcpTransport_rch & | transport_impl, |
const ACE_INET_Addr & | remote_address, | ||
Priority | priority, | ||
bool | is_loopback, | ||
bool | is_active | ||
) |
Definition at line 30 of file TcpDataLink.cpp.
References DBG_ENTRY_LVL.
|
virtual |
void OpenDDS::DCPS::TcpDataLink::ack_received | ( | const ReceivedDataSample & | sample | ) |
Definition at line 408 of file TcpDataLink.cpp.
References ACE_DEBUG, ACE_TEXT(), OpenDDS::DCPS::LogGuid::c_str(), OpenDDS::DCPS::SequenceNumber::getValue(), OpenDDS::DCPS::ReceivedDataSample::header_, LM_DEBUG, pending_request_acks_, pending_request_acks_lock_, OpenDDS::DCPS::DataSampleHeader::publication_id_, send_strategy(), OpenDDS::DCPS::DataSampleHeader::sequence_, and OpenDDS::DCPS::Transport_debug_level.
Referenced by OpenDDS::DCPS::TcpReceiveStrategy::deliver_sample().
bool OpenDDS::DCPS::TcpDataLink::check_active_client | ( | const GUID_t & | local_id | ) |
Definition at line 88 of file TcpDataLink.cpp.
References stopped_clients_, and stopped_clients_mutex_.
void OpenDDS::DCPS::TcpDataLink::client_stop | ( | const GUID_t & | local_id | ) |
Definition at line 95 of file TcpDataLink.cpp.
References send_strategy(), stopped_clients_, and stopped_clients_mutex_.
int OpenDDS::DCPS::TcpDataLink::connect | ( | const TcpConnection_rch & | connection, |
const RcHandle< TcpSendStrategy > & | send_strategy, | ||
const RcHandle< TcpReceiveStrategy > & | receive_strategy | ||
) |
Called when an established connection object is available for this TcpDataLink. Called by the TcpTransport's connect_datalink() method.
The TcpTransport calls this method when it has an established connection object for us. This call puts this TcpDataLink into the "connected" state.
Definition at line 138 of file TcpDataLink.cpp.
References ACE_ERROR_RETURN, ACE_NONBLOCK, ACE_TEXT(), connection_, DBG_ENTRY_LVL, do_association_actions(), LM_ERROR, OpenDDS::DCPS::rchandle_from(), OpenDDS::DCPS::DataLink::start(), and OpenDDS::DCPS::DataLink::strategy_lock_.
Referenced by OpenDDS::DCPS::TcpTransport::connect_tcp_datalink().
void OpenDDS::DCPS::TcpDataLink::do_association_actions | ( | ) |
Definition at line 498 of file TcpDataLink.cpp.
References connection_, OpenDDS::DCPS::DataLink::invoke_on_start_callbacks(), OpenDDS::DCPS::GuidConverter::isReader(), OpenDDS::DCPS::TransportSendStrategy::link_released(), OpenDDS::DCPS::DataLink::on_start_callbacks_, send_association_msg(), OpenDDS::DCPS::DataLink::send_strategy_, and OpenDDS::DCPS::DataLink::strategy_lock_.
Referenced by OpenDDS::DCPS::TcpTransport::accept_datalink(), connect(), OpenDDS::DCPS::TcpTransport::connect_datalink(), reconnect(), and reuse_existing_connection().
void OpenDDS::DCPS::TcpDataLink::drop_pending_request_acks | ( | ) |
Definition at line 563 of file TcpDataLink.cpp.
References pending_request_acks_, and pending_request_acks_lock_.
Referenced by OpenDDS::DCPS::TcpConnection::disconnect(), OpenDDS::DCPS::TcpConnection::notify_connection_lost(), OpenDDS::DCPS::TcpReceiveStrategy::reset(), and OpenDDS::DCPS::TcpReceiveStrategy::stop_i().
ACE_INLINE OpenDDS::DCPS::TcpConnection_rch OpenDDS::DCPS::TcpDataLink::get_connection | ( | void | ) |
Definition at line 22 of file TcpDataLink.inl.
References connection_, and OPENDDS_END_VERSIONED_NAMESPACE_DECL.
Referenced by OpenDDS::DCPS::TcpTransport::fresh_link(), OpenDDS::DCPS::TcpSendStrategy::get_handle(), OpenDDS::DCPS::TcpSynchResource::notify_lost_on_backpressure_timeout(), OpenDDS::DCPS::TcpReceiveStrategy::receive_bytes(), OpenDDS::DCPS::TcpSendStrategy::relink(), OpenDDS::DCPS::TcpReceiveStrategy::relink(), OpenDDS::DCPS::TcpSendStrategy::send_bytes_i(), and OpenDDS::DCPS::TcpReceiveStrategy::start_i().
|
privatevirtual |
Reimplemented from OpenDDS::DCPS::DataLink.
Definition at line 389 of file TcpDataLink.cpp.
References ACE_DEBUG, ACE_TEXT(), connection_, OpenDDS::DCPS::TransportQueueElement::data_dropped(), OpenDDS::DCPS::SequenceNumber::getValue(), LM_DEBUG, pending_request_acks_, pending_request_acks_lock_, OpenDDS::DCPS::TransportQueueElement::publication_id(), OpenDDS::DCPS::TransportQueueElement::sequence(), and OpenDDS::DCPS::Transport_debug_level.
bool OpenDDS::DCPS::TcpDataLink::is_release_pending | ( | ) | const |
Get release pending flag.
Definition at line 383 of file TcpDataLink.cpp.
References release_is_pending_.
Referenced by OpenDDS::DCPS::TcpConnection::active_reconnect_i().
|
virtual |
Only called by our TransportImpl object.
Return Codes: 0 means successful reservation made. -1 means failure.
Reimplemented from OpenDDS::DCPS::DataLink.
Definition at line 588 of file TcpDataLink.cpp.
References OpenDDS::DCPS::DataLink::make_reservation(), send_association_msg(), stopped_clients_, and stopped_clients_mutex_.
|
virtual |
Only called by our TransportImpl object.
Return Codes: 0 means successful reservation made. -1 means failure.
Reimplemented from OpenDDS::DCPS::DataLink.
Definition at line 603 of file TcpDataLink.cpp.
References OpenDDS::DCPS::DataLink::make_reservation(), OPENDDS_END_VERSIONED_NAMESPACE_DECL, send_association_msg(), stopped_clients_, and stopped_clients_mutex_.
|
private |
|
private |
|
virtual |
Called before release the datalink or before shutdown to let the concrete DataLink to do anything necessary.
Reimplemented from OpenDDS::DCPS::DataLink.
Definition at line 107 of file TcpDataLink.cpp.
References connection_, DBG_ENTRY_LVL, graceful_disconnect_sent_, OpenDDS::DCPS::DataLink::pre_stop_i(), receive_strategy(), and send_graceful_disconnect_message().
OpenDDS::DCPS::TcpReceiveStrategy_rch OpenDDS::DCPS::TcpDataLink::receive_strategy | ( | ) |
Definition at line 581 of file TcpDataLink.cpp.
References OpenDDS::DCPS::DataLink::receive_strategy_, OpenDDS::DCPS::static_rchandle_cast(), and OpenDDS::DCPS::DataLink::strategy_lock_.
Referenced by OpenDDS::DCPS::TcpConnection::handle_close(), pre_stop_i(), OpenDDS::DCPS::TcpConnection::receive_strategy(), and request_ack_received().
int OpenDDS::DCPS::TcpDataLink::reconnect | ( | const TcpConnection_rch & | connection | ) |
Associate the new connection object with this datalink object. The states of the "old" connection object are copied to the new connection object and the "old" connection object is replaced by the new connection object.
Definition at line 240 of file TcpDataLink.cpp.
References OpenDDS::DCPS::TcpTransport::connect_tcp_datalink(), connection_, DBG_ENTRY_LVL, do_association_actions(), OpenDDS::DCPS::dynamic_rchandle_cast(), OpenDDS::DCPS::DataLink::impl(), OpenDDS::DCPS::RcHandle< T >::in(), LM_ERROR, OpenDDS::DCPS::DataLink::receive_strategy_, OpenDDS::DCPS::RcHandle< T >::reset(), OpenDDS::DCPS::DataLink::send_strategy_, OpenDDS::DCPS::DataLink::strategy_lock_, and VDBG_LVL.
Referenced by OpenDDS::DCPS::TcpTransport::fresh_link().
OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE const ACE_INET_Addr & OpenDDS::DCPS::TcpDataLink::remote_address | ( | ) | const |
Accessor for the remote address.
Definition at line 15 of file TcpDataLink.inl.
References ACE_INLINE, DBG_ENTRY_LVL, and remote_address_.
Referenced by OpenDDS::DCPS::TcpTransport::release_datalink(), and OpenDDS::DCPS::TcpTransport::unbind_link().
void OpenDDS::DCPS::TcpDataLink::request_ack_received | ( | const ReceivedDataSample & | sample | ) |
Definition at line 449 of file TcpDataLink.cpp.
References ACE_CDR_BYTE_ORDER, ACE_DEFAULT_MESSAGE_BLOCK_PRIORITY, OpenDDS::DCPS::DataSampleHeader::byte_order_, OpenDDS::DCPS::unique_ptr< T, Deleter >::get(), OpenDDS::DCPS::DataSampleHeader::get_max_serialized_size(), OpenDDS::DCPS::guid_cdr_size, OpenDDS::DCPS::ReceivedDataSample::header_, OpenDDS::DCPS::DataLink::invoke_on_start_callbacks(), ACE_Time_Value::max_time, ACE_Message_Block::MB_DATA, OpenDDS::DCPS::DataSampleHeader::message_id_, OpenDDS::DCPS::DataSampleHeader::message_length_, OpenDDS::DCPS::move(), OpenDDS::DCPS::DataSampleHeader::publication_id_, OpenDDS::DCPS::DataSampleHeader::publisher_id_, receive_strategy(), OpenDDS::DCPS::SAMPLE_ACK, send_i(), OpenDDS::DCPS::DataSampleHeader::sequence_, and ACE_Time_Value::zero.
Referenced by OpenDDS::DCPS::TcpReceiveStrategy::deliver_sample().
int OpenDDS::DCPS::TcpDataLink::reuse_existing_connection | ( | const TcpConnection_rch & | connection | ) |
Definition at line 183 of file TcpDataLink.cpp.
References connection_, DBG_ENTRY_LVL, do_association_actions(), OpenDDS::DCPS::RcHandle< T >::in(), OpenDDS::DCPS::DataLink::is_active_, OpenDDS::DCPS::RcHandle< T >::is_nil(), LM_DEBUG, OpenDDS::DCPS::DataLink::receive_strategy_, OpenDDS::DCPS::TcpReceiveStrategy::reset(), OpenDDS::DCPS::TcpSendStrategy::reset(), OpenDDS::DCPS::DataLink::send_strategy_, and VDBG_LVL.
Referenced by OpenDDS::DCPS::TcpTransport::connect_tcp_datalink().
|
private |
Definition at line 530 of file TcpDataLink.cpp.
References ACE_CDR_BYTE_ORDER, ACE_DEFAULT_MESSAGE_BLOCK_PRIORITY, OpenDDS::DCPS::DataSampleHeader::byte_order_, OpenDDS::DCPS::unique_ptr< T, Deleter >::get(), OpenDDS::DCPS::DataSampleHeader::get_max_serialized_size(), OpenDDS::DCPS::guid_cdr_size, ACE_Time_Value::max_time, ACE_Message_Block::MB_DATA, OpenDDS::DCPS::DataSampleHeader::message_id_, OpenDDS::DCPS::DataSampleHeader::message_length_, OpenDDS::DCPS::move(), OpenDDS::DCPS::DataSampleHeader::publication_id_, OpenDDS::DCPS::DataSampleHeader::publisher_id_, OpenDDS::DCPS::REQUEST_ACK, send_i(), OpenDDS::DCPS::DataSampleHeader::sequence_, and ACE_Time_Value::zero.
Referenced by do_association_actions(), and make_reservation().
|
private |
Definition at line 304 of file TcpDataLink.cpp.
References ACE_DEFAULT_MESSAGE_BLOCK_PRIORITY, DBG_ENTRY_LVL, OpenDDS::DCPS::DataSampleHeader::get_max_serialized_size(), OpenDDS::DCPS::GRACEFUL_DISCONNECT, ACE_Message_Block::length(), ACE_Time_Value::max_time, ACE_Message_Block::MB_DATA, OpenDDS::DCPS::DataSampleHeader::message_id_, OpenDDS::DCPS::DataSampleHeader::message_length_, OpenDDS::DCPS::move(), OpenDDS::DCPS::unique_ptr< T, Deleter >::release(), send_i(), OpenDDS::DCPS::DataLink::send_strategy_, OpenDDS::DCPS::TransportSendStrategy::terminate_send(), ACE_Message_Block::wr_ptr(), and ACE_Time_Value::zero.
Referenced by pre_stop_i().
|
protectedvirtual |
Reimplemented from OpenDDS::DCPS::DataLink.
Definition at line 68 of file TcpDataLink.cpp.
References OpenDDS::DCPS::TransportQueueElement::data_dropped(), OpenDDS::DCPS::TransportQueueElement::publication_id(), OpenDDS::DCPS::DataLink::send_i(), stopped_clients_, and stopped_clients_mutex_.
Referenced by request_ack_received(), send_association_msg(), and send_graceful_disconnect_message().
|
protectedvirtual |
Definition at line 79 of file TcpDataLink.cpp.
References OpenDDS::DCPS::DataLink::send_stop_i(), stopped_clients_, and stopped_clients_mutex_.
OpenDDS::DCPS::TcpSendStrategy_rch OpenDDS::DCPS::TcpDataLink::send_strategy | ( | ) |
Definition at line 574 of file TcpDataLink.cpp.
References OpenDDS::DCPS::DataLink::send_strategy_, OpenDDS::DCPS::static_rchandle_cast(), and OpenDDS::DCPS::DataLink::strategy_lock_.
Referenced by ack_received(), client_stop(), OpenDDS::DCPS::TcpConnection::handle_close(), OpenDDS::DCPS::TcpConnection::notify_connection_lost(), and OpenDDS::DCPS::TcpConnection::send_strategy().
void OpenDDS::DCPS::TcpDataLink::set_release_pending | ( | bool | flag | ) |
Set release pending flag.
Definition at line 377 of file TcpDataLink.cpp.
References release_is_pending_.
Referenced by OpenDDS::DCPS::TcpTransport::find_datalink_i(), and OpenDDS::DCPS::TcpTransport::release_datalink().
|
protectedvirtual |
Called when the DataLink is self-releasing because all of its reservations have been released, or when the TransportImpl is handling a shutdown() call.
Called when the DataLink has been "stopped" for some reason. It could be called from the DataLink::transport_shutdown() method (when the TransportImpl is handling a shutdown() call). Or, it could be called from the DataLink::release_reservations() method, when it discovers that it has just released the last remaining reservations from the DataLink, and the DataLink is in the process of "releasing" itself.
Reimplemented from OpenDDS::DCPS::DataLink.
Definition at line 56 of file TcpDataLink.cpp.
References connection_, and DBG_ENTRY_LVL.
|
private |
Definition at line 96 of file TcpDataLink.h.
Referenced by connect(), do_association_actions(), get_connection(), handle_send_request_ack(), pre_stop_i(), reconnect(), reuse_existing_connection(), and stop_i().
|
private |
Definition at line 97 of file TcpDataLink.h.
Referenced by pre_stop_i().
|
private |
Definition at line 101 of file TcpDataLink.h.
Referenced by ack_received(), drop_pending_request_acks(), and handle_send_request_ack().
|
private |
Definition at line 100 of file TcpDataLink.h.
Referenced by ack_received(), drop_pending_request_acks(), and handle_send_request_ack().
|
private |
Definition at line 98 of file TcpDataLink.h.
Referenced by is_release_pending(), and set_release_pending().
|
private |
Definition at line 95 of file TcpDataLink.h.
Referenced by remote_address().
|
private |
Definition at line 103 of file TcpDataLink.h.
Referenced by check_active_client(), client_stop(), make_reservation(), send_i(), and send_stop_i().
|
mutableprivate |
Definition at line 104 of file TcpDataLink.h.
Referenced by check_active_client(), client_stop(), make_reservation(), send_i(), and send_stop_i().