OpenDDS  Snapshot(2023/04/07-19:43)
Classes | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
OpenDDS::DCPS::TransportImpl Class Referenceabstract

#include <TransportImpl.h>

Inheritance diagram for OpenDDS::DCPS::TransportImpl:
Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::TransportImpl:
Collaboration graph
[legend]

Classes

struct  AcceptConnectResult
 
struct  ConnectionAttribs
 
struct  DoClear
 
struct  RemoteTransport
 

Public Member Functions

virtual ~TransportImpl ()
 
virtual void unbind_link (DataLink *link)
 Remove any pending_release mappings. More...
 
bool release_link_resources (DataLink *link)
 
TransportInst_rch config () const
 
virtual bool connection_info_i (TransportLocator &local_info, ConnectionInfoFlags flags) const =0
 
virtual void register_for_reader (const GUID_t &, const GUID_t &, const GUID_t &, const TransportLocatorSeq &, OpenDDS::DCPS::DiscoveryListener *)
 
virtual void unregister_for_reader (const GUID_t &, const GUID_t &, const GUID_t &)
 
virtual void register_for_writer (const GUID_t &, const GUID_t &, const GUID_t &, const TransportLocatorSeq &, DiscoveryListener *)
 
virtual void unregister_for_writer (const GUID_t &, const GUID_t &, const GUID_t &)
 
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 ()
 
virtual void append_transport_statistics (TransportStatisticsSequence &)
 
ACE_Reactor_Timer_Interfacetimer () const
 Interface to the transport's reactor for scheduling timers. More...
 
ACE_Reactorreactor () const
 
ACE_thread_t reactor_owner () const
 
bool is_shut_down () const
 
void create_reactor_task (bool useAsyncSend=false, const OPENDDS_STRING &name="")
 
void dump ()
 Diagnostic aid. More...
 
OPENDDS_STRING dump_to_str ()
 
void report ()
 
virtual WeakRcHandle< ICE::Endpointget_ice_endpoint ()
 
virtual void rtps_relay_only_now (bool)
 
virtual void use_rtps_relay_now (bool)
 
virtual void use_ice_now (bool)
 
ReactorTask_rch reactor_task ()
 
EventDispatcher_rch event_dispatcher ()
 
int acquire ()
 
int tryacquire ()
 
int release ()
 
int remove ()
 
virtual OPENDDS_STRING transport_type () const =0
 
bool connection_info (TransportLocator &local_info, ConnectionInfoFlags flags) const
 
- Public Member Functions inherited from OpenDDS::DCPS::RcObject
virtual ~RcObject ()
 
virtual void _add_ref ()
 
virtual void _remove_ref ()
 
long ref_count () const
 
WeakObject_get_weak_object () const
 

Public Attributes

LockType lock_
 Lock to protect the config_ and reactor_task_ data members. More...
 
WeakRcHandle< TransportInstconfig_
 
ReactorTask_rch reactor_task_
 
EventDispatcher_rch event_dispatcher_
 smart ptr to the associated DL cleanup task More...
 
unique_ptr< Monitormonitor_
 Monitor object for this entity. More...
 

Protected Types

typedef ACE_SYNCH_MUTEX LockType
 
typedef ACE_Guard< LockTypeGuardType
 

Protected Member Functions

 TransportImpl (TransportInst_rch config)
 
bool open ()
 
virtual AcceptConnectResult connect_datalink (const RemoteTransport &remote, const ConnectionAttribs &attribs, const TransportClient_rch &client)=0
 
virtual AcceptConnectResult accept_datalink (const RemoteTransport &remote, const ConnectionAttribs &attribs, const TransportClient_rch &client)=0
 
virtual void stop_accepting_or_connecting (const TransportClient_wrch &client, const GUID_t &remote_id, bool disassociate, bool association_failed)=0
 
virtual void shutdown_i ()=0
 
typedef OPENDDS_MULTIMAP (TransportClient_wrch, DataLink_rch) PendConnMap
 
void add_pending_connection (const TransportClient_rch &client, DataLink_rch link)
 
void shutdown ()
 
- Protected Member Functions inherited from OpenDDS::DCPS::RcObject
 RcObject ()
 

Protected Attributes

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...
 

Private Member Functions

virtual void release_datalink (DataLink *link)=0
 
virtual void client_stop (const GUID_t &)
 
DataLinkfind_connect_i (const GUID_t &local_id, const AssociationData &remote_association, const ConnectionAttribs &attribs, bool active, bool connect)
 
virtual void local_crypto_handle (DDS::Security::ParticipantCryptoHandle)
 

Friends

class TransportInst
 
class TransportClient
 
class DataLink
 

Detailed Description

The TransportImpl class includes the abstract methods that must be implemented by any implementation to provide data delivery service to the DCPS implementation. This includes methods to send data, received data, configure the operation, and manage associations and datalinks between local and remote objects of the implementation.

Notes about object ownership: 1)Has longer lifetime than the publisher and subscriber objects. The publishers and subscribers are owned by the DomainParticipant and transport factory shutdown is always after DomainParticipant factory shutdown. 2)The concrete transport object owns the datalink objects. 3)Own a DataLinkCleanup object. 4)Reference to TransportInst object and TransportReactorTask object owned by TransportRegistry. 5)During transport shutdown, if this object does not have ownership of an object but has a references via smart pointer then the reference should be freed; if this object has ownership of task objects then the tasks should be closed.

Definition at line 64 of file TransportImpl.h.

Member Typedef Documentation

◆ GuardType

Definition at line 228 of file TransportImpl.h.

◆ LockType

Definition at line 227 of file TransportImpl.h.

Constructor & Destructor Documentation

◆ ~TransportImpl()

OpenDDS::DCPS::TransportImpl::~TransportImpl ( )
virtual

Definition at line 44 of file TransportImpl.cpp.

References DBG_ENTRY_LVL, event_dispatcher_, and OpenDDS::DCPS::EventDispatcher::shutdown().

45 {
46  DBG_ENTRY_LVL("TransportImpl", "~TransportImpl", 6);
48 }
EventDispatcher_rch event_dispatcher_
smart ptr to the associated DL cleanup task
virtual void shutdown(bool immediate=false)=0
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ TransportImpl()

OpenDDS::DCPS::TransportImpl::TransportImpl ( TransportInst_rch  config)
protected

Definition at line 33 of file TransportImpl.cpp.

References DBG_ENTRY_LVL, monitor_, and TheServiceParticipant.

34  : config_(config)
35  , event_dispatcher_(make_rch<ServiceEventDispatcher>(1))
36  , is_shut_down_(false)
37 {
38  DBG_ENTRY_LVL("TransportImpl", "TransportImpl", 6);
39  if (TheServiceParticipant->monitor_factory_) {
40  monitor_.reset(TheServiceParticipant->monitor_factory_->create_transport_monitor(this));
41  }
42 }
WeakRcHandle< TransportInst > config_
unique_ptr< Monitor > monitor_
Monitor object for this entity.
AtomicBool is_shut_down_
Id of the last link established.
EventDispatcher_rch event_dispatcher_
smart ptr to the associated DL cleanup task
TransportInst_rch config() const
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68
#define TheServiceParticipant

Member Function Documentation

◆ accept_datalink()

virtual AcceptConnectResult OpenDDS::DCPS::TransportImpl::accept_datalink ( const RemoteTransport remote,
const ConnectionAttribs attribs,
const TransportClient_rch client 
)
protectedpure virtual

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().

Implemented in OpenDDS::DCPS::TcpTransport, OpenDDS::DCPS::RtpsUdpTransport, OpenDDS::DCPS::ShmemTransport, OpenDDS::DCPS::MulticastTransport, and OpenDDS::DCPS::UdpTransport.

Referenced by OpenDDS::DCPS::TransportClient::associate().

◆ acquire()

int OpenDDS::DCPS::TransportImpl::acquire ( )

Called by our friends, the TransportClient, and the DataLink. Since this TransportImpl can be attached to many TransportClient objects, and each TransportClient object could be "running" in a separate thread, we need to protect all of the "reservation" methods with a lock. The protocol is that a client of ours must "acquire" our reservation_lock_ before it can proceed to call any methods that affect the DataLink reservations. It should release the reservation_lock_ as soon as it is done.

◆ add_pending_connection()

void OpenDDS::DCPS::TransportImpl::add_pending_connection ( const TransportClient_rch client,
DataLink_rch  link 
)
protected

◆ append_transport_statistics()

virtual void OpenDDS::DCPS::TransportImpl::append_transport_statistics ( TransportStatisticsSequence )
inlinevirtual

Reimplemented in OpenDDS::DCPS::RtpsUdpTransport.

Definition at line 114 of file TransportImpl.h.

References name, and OPENDDS_STRING.

114 {}

◆ client_stop()

virtual void OpenDDS::DCPS::TransportImpl::client_stop ( const GUID_t )
inlineprivatevirtual

◆ config()

◆ connect_datalink()

virtual AcceptConnectResult OpenDDS::DCPS::TransportImpl::connect_datalink ( const RemoteTransport remote,
const ConnectionAttribs attribs,
const TransportClient_rch client 
)
protectedpure virtual

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().

Implemented in OpenDDS::DCPS::TcpTransport, OpenDDS::DCPS::RtpsUdpTransport, OpenDDS::DCPS::ShmemTransport, OpenDDS::DCPS::MulticastTransport, and OpenDDS::DCPS::UdpTransport.

Referenced by OpenDDS::DCPS::TransportClient::initiate_connect_i().

◆ connection_info()

ACE_INLINE bool OpenDDS::DCPS::TransportImpl::connection_info ( TransportLocator local_info,
ConnectionInfoFlags  flags 
) const

Called by our friend, the TransportClient. Accessor for the TransportInterfaceInfo. Accepts a reference to a TransportInterfaceInfo object that will be "populated" with this TransportImpl's connection information (ie, how another process would connect to this TransportImpl).

Definition at line 52 of file TransportImpl.inl.

References connection_info_i(), and OPENDDS_END_VERSIONED_NAMESPACE_DECL.

Referenced by OpenDDS::DCPS::TransportClient::populate_connection_info(), and reactor_owner().

53 {
54  return connection_info_i(local_info, flags);
55 }
virtual bool connection_info_i(TransportLocator &local_info, ConnectionInfoFlags flags) const =0

◆ connection_info_i()

virtual bool OpenDDS::DCPS::TransportImpl::connection_info_i ( TransportLocator local_info,
ConnectionInfoFlags  flags 
) const
pure virtual

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.

Implemented in OpenDDS::DCPS::RtpsUdpTransport, OpenDDS::DCPS::TcpTransport, OpenDDS::DCPS::ShmemTransport, OpenDDS::DCPS::MulticastTransport, and OpenDDS::DCPS::UdpTransport.

Referenced by connection_info().

◆ create_reactor_task()

void OpenDDS::DCPS::TransportImpl::create_reactor_task ( bool  useAsyncSend = false,
const OPENDDS_STRING name = "" 
)

Create the reactor task using sync send or optionally async send by parameter on supported Windows platforms only.

Definition at line 100 of file TransportImpl.cpp.

References OpenDDS::DCPS::RcHandle< T >::in(), is_shut_down_, name, OpenDDS::DCPS::ReactorTask::open_reactor_task(), reactor_task_, and TheServiceParticipant.

Referenced by OpenDDS::DCPS::UdpTransport::configure_i(), OpenDDS::DCPS::MulticastTransport::configure_i(), OpenDDS::DCPS::ShmemTransport::configure_i(), OpenDDS::DCPS::RtpsUdpTransport::configure_i(), and OpenDDS::DCPS::TcpTransport::configure_i().

101 {
102  if (is_shut_down_ || this->reactor_task_.in()) {
103  return;
104  }
105 
106  this->reactor_task_= make_rch<ReactorTask>(useAsyncSend);
107 
109  &TheServiceParticipant->get_thread_status_manager(),
110  name)) {
111  throw Transport::MiscProblem(); // error already logged by TRT::open()
112  }
113 }
int open_reactor_task(void *, ThreadStatusManager *thread_status_manager=0, const String &name="")
Definition: ReactorTask.cpp:79
AtomicBool is_shut_down_
Id of the last link established.
const char *const name
Definition: debug.cpp:60
#define TheServiceParticipant

◆ dump()

void OpenDDS::DCPS::TransportImpl::dump ( void  )

Diagnostic aid.

Definition at line 143 of file TransportImpl.cpp.

References ACE_DEBUG, ACE_TEXT(), dump_to_str(), LM_DEBUG, and OPENDDS_STRING.

Referenced by OpenDDS::DCPS::TransportSendStrategy::direct_send().

144 {
145  ACE_DEBUG((LM_DEBUG,
146  ACE_TEXT("(%P|%t) TransportImpl::dump() -\n%C"),
147  dump_to_str().c_str()));
148 }
#define ACE_DEBUG(X)
ACE_TEXT("TCP_Factory")

◆ dump_to_str()

OPENDDS_STRING OpenDDS::DCPS::TransportImpl::dump_to_str ( )

Definition at line 151 of file TransportImpl.cpp.

References config_, OpenDDS::DCPS::TransportInst::dump_to_str(), OPENDDS_END_VERSIONED_NAMESPACE_DECL, and OPENDDS_STRING.

Referenced by dump(), and open().

152 {
153  TransportInst_rch cfg = config_.lock();
154  return cfg ? cfg->dump_to_str() : OPENDDS_STRING();
155 }
WeakRcHandle< TransportInst > config_
#define OPENDDS_STRING
RcHandle< TransportInst > TransportInst_rch
The type definition for the smart-pointer to the underlying type.

◆ event_dispatcher()

EventDispatcher_rch OpenDDS::DCPS::TransportImpl::event_dispatcher ( )
inline

Definition at line 182 of file TransportImpl.h.

References open().

Referenced by OpenDDS::DCPS::TransportInst::event_dispatcher().

182 { return event_dispatcher_; }
EventDispatcher_rch event_dispatcher_
smart ptr to the associated DL cleanup task

◆ find_connect_i()

DataLink* OpenDDS::DCPS::TransportImpl::find_connect_i ( const GUID_t local_id,
const AssociationData remote_association,
const ConnectionAttribs attribs,
bool  active,
bool  connect 
)
private

◆ get_ice_endpoint()

virtual WeakRcHandle<ICE::Endpoint> OpenDDS::DCPS::TransportImpl::get_ice_endpoint ( )
inlinevirtual

◆ get_last_recv_locator()

virtual void OpenDDS::DCPS::TransportImpl::get_last_recv_locator ( const GUID_t ,
TransportLocator  
)
inlinevirtual

Reimplemented in OpenDDS::DCPS::RtpsUdpTransport.

Definition at line 110 of file TransportImpl.h.

111  {}

◆ is_shut_down()

bool OpenDDS::DCPS::TransportImpl::is_shut_down ( ) const

◆ local_crypto_handle()

virtual void OpenDDS::DCPS::TransportImpl::local_crypto_handle ( DDS::Security::ParticipantCryptoHandle  )
inlineprivatevirtual

Reimplemented in OpenDDS::DCPS::RtpsUdpTransport.

Definition at line 266 of file TransportImpl.h.

References OPENDDS_STRING, and release().

Referenced by OpenDDS::DCPS::TransportClient::enable_transport_using_config().

266 {}

◆ open()

bool OpenDDS::DCPS::TransportImpl::open ( void  )
protected

Definition at line 75 of file TransportImpl.cpp.

References ACE_DEBUG, ACE_TEXT(), dump_to_str(), LM_DEBUG, monitor_, and OpenDDS::DCPS::Transport_debug_level.

Referenced by OpenDDS::DCPS::MulticastTransport::MulticastTransport(), OpenDDS::DCPS::RtpsUdpTransport::RtpsUdpTransport(), OpenDDS::DCPS::ShmemTransport::ShmemTransport(), OpenDDS::DCPS::TcpTransport::TcpTransport(), and OpenDDS::DCPS::UdpTransport::UdpTransport().

76 {
77  // Success.
78  if (this->monitor_) {
79  this->monitor_->report();
80  }
81 
82  if (Transport_debug_level > 0) {
83 
84  ACE_DEBUG((LM_DEBUG,
85  ACE_TEXT("(%P|%t) TransportImpl::open()\n%C"),
86  dump_to_str().c_str()));
87  }
88 
89  return true;
90 }
#define ACE_DEBUG(X)
unique_ptr< Monitor > monitor_
Monitor object for this entity.
OpenDDS_Dcps_Export unsigned int Transport_debug_level
Transport Logging verbosity level.
Definition: debug.cpp:25
ACE_TEXT("TCP_Factory")

◆ OPENDDS_MULTIMAP()

typedef OpenDDS::DCPS::TransportImpl::OPENDDS_MULTIMAP ( TransportClient_wrch  ,
DataLink_rch   
)
protected

◆ reactor()

ACE_INLINE ACE_Reactor * OpenDDS::DCPS::TransportImpl::reactor ( void  ) const

Definition at line 38 of file TransportImpl.inl.

References ACE_INLINE, OpenDDS::DCPS::ReactorTask::get_reactor(), OpenDDS::DCPS::RcHandle< T >::is_nil(), and reactor_task_.

Referenced by OpenDDS::DCPS::RtpsUdpTransport::configure_i(), and timer().

39 {
40  ReactorTask_rch task = this->reactor_task_;
41  return task.is_nil() ? 0 : task->get_reactor();
42 }
RcHandle< ReactorTask > ReactorTask_rch
The type definition for the smart-pointer to the underlying type.

◆ reactor_owner()

ACE_INLINE ACE_thread_t OpenDDS::DCPS::TransportImpl::reactor_owner ( ) const

◆ reactor_task()

ACE_INLINE OpenDDS::DCPS::ReactorTask_rch OpenDDS::DCPS::TransportImpl::reactor_task ( )

Accessor to obtain a "copy" of the reference to the reactor task. Caller is responsible for the "copy" of the reference that is returned.

Definition at line 25 of file TransportImpl.inl.

References ACE_INLINE, DBG_ENTRY_LVL, and reactor_task_.

Referenced by OpenDDS::DCPS::RtpsUdpTransport::configure_i(), OpenDDS::DCPS::TcpTransport::configure_i(), OpenDDS::DCPS::TcpTransport::connect_tcp_datalink(), OpenDDS::DCPS::UdpTransport::make_datalink(), OpenDDS::DCPS::MulticastTransport::make_datalink(), OpenDDS::DCPS::RtpsUdpTransport::make_datalink(), OpenDDS::DCPS::DataLink::notify_reactor(), and OpenDDS::DCPS::TransportInst::reactor_task().

26 {
27  DBG_ENTRY_LVL("TransportImpl","reactor_task",6);
28  return this->reactor_task_;
29 }
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ register_for_reader()

virtual void OpenDDS::DCPS::TransportImpl::register_for_reader ( const GUID_t ,
const GUID_t ,
const GUID_t ,
const TransportLocatorSeq ,
OpenDDS::DCPS::DiscoveryListener  
)
inlinevirtual

Reimplemented in OpenDDS::DCPS::RtpsUdpTransport.

Definition at line 87 of file TransportImpl.h.

Referenced by OpenDDS::DCPS::TransportClient::register_for_reader().

91  { }

◆ register_for_writer()

virtual void OpenDDS::DCPS::TransportImpl::register_for_writer ( const GUID_t ,
const GUID_t ,
const GUID_t ,
const TransportLocatorSeq ,
DiscoveryListener  
)
inlinevirtual

Reimplemented in OpenDDS::DCPS::RtpsUdpTransport.

Definition at line 97 of file TransportImpl.h.

Referenced by OpenDDS::DCPS::TransportClient::register_for_writer().

101  { }

◆ release()

int OpenDDS::DCPS::TransportImpl::release ( )

◆ release_datalink()

virtual void OpenDDS::DCPS::TransportImpl::release_datalink ( DataLink link)
privatepure virtual

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.

Implemented in OpenDDS::DCPS::RtpsUdpTransport, OpenDDS::DCPS::TcpTransport, OpenDDS::DCPS::ShmemTransport, OpenDDS::DCPS::MulticastTransport, and OpenDDS::DCPS::UdpTransport.

Referenced by OpenDDS::DCPS::DataLink::release_reservations().

◆ release_link_resources()

bool OpenDDS::DCPS::TransportImpl::release_link_resources ( DataLink link)

Callback from the DataLink to clean up any associated resources. This usually is done when the DataLink is lost. The call is made with no transport/DCPS locks held.

Definition at line 124 of file TransportImpl.cpp.

References DBG_ENTRY_LVL, OpenDDS::DCPS::EventDispatcher::dispatch(), event_dispatcher_, and OpenDDS::DCPS::rchandle_from().

Referenced by OpenDDS::DCPS::DataLink::release_resources().

125 {
126  DBG_ENTRY_LVL("TransportImpl", "release_link_resources",6);
127 
128  DataLink_rch link_rch = rchandle_from(link);
129  EventBase_rch do_clear = make_rch<DoClear>(link_rch);
130  event_dispatcher_->dispatch(do_clear);
131  return true;
132 }
RcHandle< DataLink > DataLink_rch
The type definition for the smart-pointer to the underlying type.
Definition: DataLink_rch.h:34
EventDispatcher_rch event_dispatcher_
smart ptr to the associated DL cleanup task
RcHandle< T > rchandle_from(T *pointer)
Definition: RcHandle_T.h:310
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68
virtual bool dispatch(EventBase_rch event)=0
RcHandle< EventBase > EventBase_rch

◆ remove()

int OpenDDS::DCPS::TransportImpl::remove ( )

◆ report()

void OpenDDS::DCPS::TransportImpl::report ( )

Definition at line 135 of file TransportImpl.cpp.

References monitor_.

136 {
137  if (this->monitor_) {
138  this->monitor_->report();
139  }
140 }
unique_ptr< Monitor > monitor_
Monitor object for this entity.

◆ rtps_relay_address_change()

virtual void OpenDDS::DCPS::TransportImpl::rtps_relay_address_change ( )
inlinevirtual

Reimplemented in OpenDDS::DCPS::RtpsUdpTransport.

Definition at line 113 of file TransportImpl.h.

113 {}

◆ rtps_relay_only_now()

virtual void OpenDDS::DCPS::TransportImpl::rtps_relay_only_now ( bool  )
inlinevirtual

Reimplemented in OpenDDS::DCPS::RtpsUdpTransport.

Definition at line 173 of file TransportImpl.h.

Referenced by OpenDDS::DCPS::TransportInst::rtps_relay_only_now().

173 {}

◆ shutdown()

void OpenDDS::DCPS::TransportImpl::shutdown ( void  )
protected

Definition at line 57 of file TransportImpl.cpp.

References DBG_ENTRY_LVL, event_dispatcher_, OpenDDS::DCPS::RcHandle< T >::is_nil(), is_shut_down_, reactor_task_, OpenDDS::DCPS::EventDispatcher::shutdown(), shutdown_i(), and OpenDDS::DCPS::ReactorTask::stop().

Referenced by OpenDDS::DCPS::TransportInst::shutdown(), and OpenDDS::DCPS::TcpTransport::TcpTransport().

58 {
59  DBG_ENTRY_LVL("TransportImpl", "shutdown", 6);
60 
61  is_shut_down_ = true;
62 
63  if (!this->reactor_task_.is_nil()) {
64  this->reactor_task_->stop();
65  }
66 
68 
69  // Tell our subclass about the "shutdown event".
70  this->shutdown_i();
71 }
AtomicBool is_shut_down_
Id of the last link established.
EventDispatcher_rch event_dispatcher_
smart ptr to the associated DL cleanup task
virtual void shutdown(bool immediate=false)=0
virtual void shutdown_i()=0
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ shutdown_i()

virtual void OpenDDS::DCPS::TransportImpl::shutdown_i ( )
protectedpure virtual

Called during the shutdown() method in order to give the concrete TransportImpl subclass a chance to do something when the shutdown "event" occurs.

Implemented in OpenDDS::DCPS::TcpTransport, OpenDDS::DCPS::RtpsUdpTransport, OpenDDS::DCPS::ShmemTransport, OpenDDS::DCPS::MulticastTransport, and OpenDDS::DCPS::UdpTransport.

Referenced by shutdown().

◆ stop_accepting_or_connecting()

virtual void OpenDDS::DCPS::TransportImpl::stop_accepting_or_connecting ( const TransportClient_wrch client,
const GUID_t remote_id,
bool  disassociate,
bool  association_failed 
)
protectedpure virtual

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.

Implemented in OpenDDS::DCPS::TcpTransport, OpenDDS::DCPS::RtpsUdpTransport, OpenDDS::DCPS::ShmemTransport, OpenDDS::DCPS::MulticastTransport, and OpenDDS::DCPS::UdpTransport.

Referenced by OpenDDS::DCPS::TransportClient::disassociate(), OpenDDS::DCPS::TransportClient::stop_associating(), OpenDDS::DCPS::TransportClient::use_datalink_i(), and OpenDDS::DCPS::TransportClient::~TransportClient().

◆ timer()

ACE_INLINE ACE_Reactor_Timer_Interface * OpenDDS::DCPS::TransportImpl::timer ( void  ) const

Interface to the transport's reactor for scheduling timers.

Definition at line 32 of file TransportImpl.inl.

References ACE_INLINE, and reactor().

Referenced by OpenDDS::DCPS::DataLink::handle_exception(), and OpenDDS::DCPS::DataLink::transport_shutdown().

33 {
34  return reactor();
35 }
ACE_Reactor * reactor() const

◆ transport_type()

virtual OPENDDS_STRING OpenDDS::DCPS::TransportImpl::transport_type ( ) const
pure virtual

◆ tryacquire()

int OpenDDS::DCPS::TransportImpl::tryacquire ( )

◆ unbind_link()

void OpenDDS::DCPS::TransportImpl::unbind_link ( DataLink link)
virtual

Remove any pending_release mappings.

Reimplemented in OpenDDS::DCPS::TcpTransport.

Definition at line 117 of file TransportImpl.cpp.

References DBG_ENTRY_LVL.

Referenced by OpenDDS::DCPS::DataLink::handle_timeout().

118 {
119  // may be overridden by subclass
120  DBG_ENTRY_LVL("TransportImpl", "unbind_link",6);
121 }
#define DBG_ENTRY_LVL(CNAME, MNAME, DBG_LVL)
Definition: EntryExit.h:68

◆ unregister_for_reader()

virtual void OpenDDS::DCPS::TransportImpl::unregister_for_reader ( const GUID_t ,
const GUID_t ,
const GUID_t  
)
inlinevirtual

Reimplemented in OpenDDS::DCPS::RtpsUdpTransport.

Definition at line 93 of file TransportImpl.h.

Referenced by OpenDDS::DCPS::TransportClient::unregister_for_reader().

95  { }

◆ unregister_for_writer()

virtual void OpenDDS::DCPS::TransportImpl::unregister_for_writer ( const GUID_t ,
const GUID_t ,
const GUID_t  
)
inlinevirtual

Reimplemented in OpenDDS::DCPS::RtpsUdpTransport.

Definition at line 103 of file TransportImpl.h.

Referenced by OpenDDS::DCPS::TransportClient::unregister_for_writer().

105  { }

◆ update_locators()

virtual void OpenDDS::DCPS::TransportImpl::update_locators ( const GUID_t ,
const TransportLocatorSeq  
)
inlinevirtual

Reimplemented in OpenDDS::DCPS::RtpsUdpTransport.

Definition at line 107 of file TransportImpl.h.

Referenced by OpenDDS::DCPS::TransportClient::update_locators().

108  { }

◆ use_ice_now()

virtual void OpenDDS::DCPS::TransportImpl::use_ice_now ( bool  )
inlinevirtual

Reimplemented in OpenDDS::DCPS::RtpsUdpTransport.

Definition at line 175 of file TransportImpl.h.

Referenced by OpenDDS::DCPS::TransportInst::use_ice_now().

175 {}

◆ use_rtps_relay_now()

virtual void OpenDDS::DCPS::TransportImpl::use_rtps_relay_now ( bool  )
inlinevirtual

Reimplemented in OpenDDS::DCPS::RtpsUdpTransport.

Definition at line 174 of file TransportImpl.h.

Referenced by OpenDDS::DCPS::TransportInst::use_rtps_relay_now().

174 {}

Friends And Related Function Documentation

◆ DataLink

friend class DataLink
friend

Definition at line 244 of file TransportImpl.h.

◆ TransportClient

friend class TransportClient
friend

Definition at line 243 of file TransportImpl.h.

◆ TransportInst

friend class TransportInst
friend

We have a few friends in the transport framework so that they can access our private methods. We do this to avoid pollution of our public interface with internal framework methods.

Definition at line 242 of file TransportImpl.h.

Member Data Documentation

◆ config_

WeakRcHandle<TransportInst> OpenDDS::DCPS::TransportImpl::config_

A reference to the TransportInst object that was supplied to us during our configure() method.

Definition at line 297 of file TransportImpl.h.

Referenced by config(), and dump_to_str().

◆ event_dispatcher_

EventDispatcher_rch OpenDDS::DCPS::TransportImpl::event_dispatcher_

smart ptr to the associated DL cleanup task

Definition at line 316 of file TransportImpl.h.

Referenced by release_link_resources(), shutdown(), and ~TransportImpl().

◆ is_shut_down_

AtomicBool OpenDDS::DCPS::TransportImpl::is_shut_down_
protected

Id of the last link established.

Definition at line 323 of file TransportImpl.h.

Referenced by create_reactor_task(), is_shut_down(), and shutdown().

◆ lock_

LockType OpenDDS::DCPS::TransportImpl::lock_
mutable

Lock to protect the config_ and reactor_task_ data members.

Definition at line 293 of file TransportImpl.h.

◆ monitor_

unique_ptr<Monitor> OpenDDS::DCPS::TransportImpl::monitor_

Monitor object for this entity.

Definition at line 319 of file TransportImpl.h.

Referenced by open(), report(), and TransportImpl().

◆ pending_connections_

PendConnMap OpenDDS::DCPS::TransportImpl::pending_connections_
protected

◆ pending_connections_lock_

LockType OpenDDS::DCPS::TransportImpl::pending_connections_lock_
mutableprotected

◆ reactor_task_

ReactorTask_rch OpenDDS::DCPS::TransportImpl::reactor_task_

The documentation for this class was generated from the following files: