OpenDDS
Snapshot(2023/04/07-19:43)
|
#include <UdpTransport.h>
Private Types | |
typedef ACE_SYNCH_MUTEX | LockType |
typedef ACE_Guard< LockType > | GuardType |
typedef ConditionVariable< LockType > | ConditionVariableType |
typedef std::vector< DataLink::OnStartCallback > | Callbacks |
Private Member Functions | |
UdpDataLink_rch | make_datalink (const ACE_INET_Addr &remote_address, Priority priority, bool active) |
PriorityKey | blob_to_key (const TransportBLOB &remote, Priority priority, ACE_INET_Addr local_addr, bool active) |
typedef | OPENDDS_MAP (PriorityKey, UdpDataLink_rch) UdpDataLinkMap |
Map of fully associated DataLinks for this transport. Protected. More... | |
typedef | OPENDDS_MAP (PriorityKey, Callbacks) PendConnMap |
Private Attributes | |
LockType | client_links_lock_ |
This lock is used to protect the client_links_ data member. More... | |
UdpDataLinkMap | client_links_ |
UdpDataLink_rch | server_link_ |
The single datalink for the passive side. No locking required. More... | |
ACE_Recursive_Thread_Mutex | connections_lock_ |
std::set< PriorityKey > | server_link_keys_ |
PendConnMap | pending_connections_ |
std::set< PriorityKey > | pending_server_link_keys_ |
Additional Inherited Members | |
![]() | |
LockType | lock_ |
Lock to protect the config_ and reactor_task_ data members. More... | |
WeakRcHandle< TransportInst > | config_ |
ReactorTask_rch | reactor_task_ |
EventDispatcher_rch | event_dispatcher_ |
smart ptr to the associated DL cleanup task More... | |
unique_ptr< Monitor > | monitor_ |
Monitor object for this entity. More... | |
![]() | |
typedef ACE_SYNCH_MUTEX | LockType |
typedef ACE_Guard< LockType > | GuardType |
![]() | |
LockType | pending_connections_lock_ |
Lock to protect the pending_connections_ data member. More... | |
PendConnMap | pending_connections_ |
AtomicBool | is_shut_down_ |
Id of the last link established. More... | |
Definition at line 29 of file UdpTransport.h.
|
private |
Definition at line 94 of file UdpTransport.h.
|
private |
Definition at line 70 of file UdpTransport.h.
|
private |
Definition at line 69 of file UdpTransport.h.
|
private |
Definition at line 68 of file UdpTransport.h.
|
explicit |
Definition at line 35 of file UdpTransport.cpp.
References configure_i(), and OpenDDS::DCPS::TransportImpl::open().
|
protectedvirtual |
accept_datalink() is called from TransportClient to initiate an association as the passive peer. A DataLink may be returned if one is already connected and ready to use, otherwise passively wait for a physical connection from the active side (either in the form of a connection event or handshaking message). Upon completion of the physical connection, the transport calls back to TransportClient::use_datalink().
Implements OpenDDS::DCPS::TransportImpl.
Definition at line 113 of file UdpTransport.cpp.
References OpenDDS::DCPS::TransportImpl::AcceptConnectResult::ACR_FAILED, OpenDDS::DCPS::TransportImpl::AcceptConnectResult::ACR_SUCCESS, OpenDDS::DCPS::PriorityKey::address(), OpenDDS::DCPS::TransportImpl::RemoteTransport::blob_, blob_to_key(), config(), connections_lock_, OpenDDS::DCPS::PriorityKey::is_active(), OpenDDS::DCPS::PriorityKey::is_loopback(), OpenDDS::DCPS::TransportImpl::is_shut_down(), LM_DEBUG, pending_connections_, pending_server_link_keys_, OpenDDS::DCPS::PriorityKey::priority(), OpenDDS::DCPS::TransportImpl::ConnectionAttribs::priority_, OpenDDS::DCPS::TransportImpl::RemoteTransport::repo_id_, server_link_, server_link_keys_, VDBG, and VDBG_LVL.
|
private |
Definition at line 256 of file UdpTransport.cpp.
References ACE_ERROR, ACE_TEXT(), LM_ERROR, and OpenDDS::DCPS::NetworkResource::to_addr().
Referenced by accept_datalink(), connect_datalink(), and passive_connection().
UdpInst_rch OpenDDS::DCPS::UdpTransport::config | ( | ) | const |
Definition at line 44 of file UdpTransport.cpp.
References OpenDDS::DCPS::TransportImpl::config(), and OpenDDS::DCPS::dynamic_rchandle_cast().
Referenced by accept_datalink(), connect_datalink(), connection_info_i(), and passive_connection().
|
protected |
Definition at line 174 of file UdpTransport.cpp.
References OpenDDS::DCPS::TransportImpl::create_reactor_task(), make_datalink(), server_link_, and TheServiceParticipant.
Referenced by UdpTransport().
|
protectedvirtual |
connect_datalink() is called from TransportClient to initiate an association as the active peer. A DataLink may be returned if one is already connected and ready to use, otherwise initiate a connection to the passive side and return from this method. Upon completion of the physical connection, the transport calls back to TransportClient::use_datalink().
Implements OpenDDS::DCPS::TransportImpl.
Definition at line 71 of file UdpTransport.cpp.
References OpenDDS::DCPS::TransportImpl::AcceptConnectResult::ACR_FAILED, OpenDDS::DCPS::PriorityKey::address(), OpenDDS::DCPS::TransportImpl::RemoteTransport::blob_, blob_to_key(), client_links_, client_links_lock_, config(), get_connection_addr(), OpenDDS::DCPS::PriorityKey::is_active(), OpenDDS::DCPS::PriorityKey::is_loopback(), OpenDDS::DCPS::RcHandle< T >::is_nil(), OpenDDS::DCPS::TransportImpl::is_shut_down(), LM_DEBUG, make_datalink(), OpenDDS::DCPS::PriorityKey::priority(), OpenDDS::DCPS::TransportImpl::ConnectionAttribs::priority_, VDBG, and VDBG_LVL.
|
protectedvirtual |
Called by our connection_info() method to allow the concrete TransportImpl subclass to do the dirty work since it really is the one that knows how to populate the supplied TransportLocator object.
Implements OpenDDS::DCPS::TransportImpl.
Definition at line 212 of file UdpTransport.cpp.
References config().
|
protected |
Definition at line 223 of file UdpTransport.cpp.
References OpenDDS::DCPS::NetworkResource::to_addr().
Referenced by connect_datalink().
|
private |
Definition at line 51 of file UdpTransport.cpp.
References ACE_ERROR, ACE_TEXT(), LM_ERROR, OpenDDS::DCPS::UdpDataLink::open(), OpenDDS::DCPS::rchandle_from(), and OpenDDS::DCPS::TransportImpl::reactor_task().
Referenced by configure_i(), and connect_datalink().
|
private |
Map of fully associated DataLinks for this transport. Protected.
|
private |
void OpenDDS::DCPS::UdpTransport::passive_connection | ( | const ACE_INET_Addr & | remote_address, |
const ReceivedDataSample & | data | ||
) |
Definition at line 278 of file UdpTransport.cpp.
References blob_to_key(), config(), connections_lock_, OpenDDS::DCPS::ReceivedDataSample::data(), OpenDDS::DCPS::ReceivedDataSample::data_length(), OpenDDS::DCPS::find(), LM_DEBUG, OpenDDS::DCPS::WeakRcHandle< T >::lock(), OPENDDS_END_VERSIONED_NAMESPACE_DECL, pending_connections_, pending_server_link_keys_, ACE_SOCK_Dgram::send(), server_link_, server_link_keys_, OpenDDS::DCPS::UdpDataLink::socket(), OpenDDS::DCPS::static_rchandle_cast(), and VDBG.
|
protectedvirtual |
Called by the TransportRegistry when this TransportImpl object is released while the TransportRegistry is handling a release() "event". The DataLink itself calls this method when it thinks it is no longer used for any associations. This occurs during a "remove associations" operation being performed by some TransportClient that uses this TransportImpl. The TransportClient is known to have acquired our reservation_lock_, so there won't be any reserve_datalink() calls being made from any other threads while we perform this release.
Implements OpenDDS::DCPS::TransportImpl.
Definition at line 240 of file UdpTransport.cpp.
References client_links_, client_links_lock_, and OpenDDS::DCPS::DataLink::stop().
|
protectedvirtual |
Called during the shutdown() method in order to give the concrete TransportImpl subclass a chance to do something when the shutdown "event" occurs.
Implements OpenDDS::DCPS::TransportImpl.
Definition at line 195 of file UdpTransport.cpp.
References client_links_, client_links_lock_, OpenDDS::DCPS::RcHandle< T >::reset(), server_link_, and OpenDDS::DCPS::DataLink::transport_shutdown().
|
protectedvirtual |
stop_accepting_or_connecting() is called from TransportClient to terminate the accepting process begun by accept_datalink() or connect_datalink(). This allows the TransportImpl to clean up any resources associated with this pending connection. The TransportClient* passed in to accept or connect is not valid after this method is called.
Implements OpenDDS::DCPS::TransportImpl.
Definition at line 149 of file UdpTransport.cpp.
References connections_lock_, LM_DEBUG, pending_connections_, and VDBG.
|
inlineprotectedvirtual |
Implements OpenDDS::DCPS::TransportImpl.
Definition at line 59 of file UdpTransport.h.
|
private |
Definition at line 78 of file UdpTransport.h.
Referenced by connect_datalink(), release_datalink(), and shutdown_i().
|
private |
This lock is used to protect the client_links_ data member.
Definition at line 73 of file UdpTransport.h.
Referenced by connect_datalink(), release_datalink(), and shutdown_i().
|
private |
This protects the pending_connections_, pending_server_link_keys_, and server_link_keys_ data members.
Definition at line 86 of file UdpTransport.h.
Referenced by accept_datalink(), passive_connection(), and stop_accepting_or_connecting().
|
private |
Locked by connections_lock_. Tracks expected connections that we have learned about in accept_datalink() but have not yet performed the handshake.
Definition at line 99 of file UdpTransport.h.
Referenced by accept_datalink(), passive_connection(), and stop_accepting_or_connecting().
|
private |
Locked by connections_lock_. These are passive-side PriorityKeys that have finished handshaking, but have not been processed by accept_datalink()
Definition at line 104 of file UdpTransport.h.
Referenced by accept_datalink(), and passive_connection().
|
private |
The single datalink for the passive side. No locking required.
Definition at line 81 of file UdpTransport.h.
Referenced by accept_datalink(), configure_i(), passive_connection(), and shutdown_i().
|
private |
Locked by connections_lock_. These are passive-side PriorityKeys that have been fully associated (processed by accept_datalink() and finished handshaking). They are ready for use and reuse via server_link_.
Definition at line 92 of file UdpTransport.h.
Referenced by accept_datalink(), and passive_connection().