OpenDDS  Snapshot(2023/04/07-19:43)
Public Member Functions | Public Attributes | List of all members
OpenDDS::DCPS::TransportClient::PendingAssoc Struct Reference
Inheritance diagram for OpenDDS::DCPS::TransportClient::PendingAssoc:
Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::TransportClient::PendingAssoc:
Collaboration graph
[legend]

Public Member Functions

 PendingAssoc (RcHandle< TransportClient > tc_rch)
 
void reset_client ()
 
bool safe_to_remove ()
 
bool initiate_connect (TransportClient *tc, Guard &guard)
 
int handle_timeout (const ACE_Time_Value &time, const void *arg)
 
- Public Member Functions inherited from OpenDDS::DCPS::RcEventHandler
 RcEventHandler ()
 
ACE_Event_Handler::Reference_Count add_reference ()
 
ACE_Event_Handler::Reference_Count remove_reference ()
 
- Public Member Functions inherited from ACE_Event_Handler
virtual ~ACE_Event_Handler (void)
 
virtual ACE_HANDLE get_handle (void) const
 
virtual void set_handle (ACE_HANDLE)
 
virtual int priority (void) const
 
virtual void priority (int priority)
 
virtual int handle_input (ACE_HANDLE fd=ACE_INVALID_HANDLE)
 
virtual int handle_output (ACE_HANDLE fd=ACE_INVALID_HANDLE)
 
virtual int handle_exception (ACE_HANDLE fd=ACE_INVALID_HANDLE)
 
virtual int handle_exit (ACE_Process *)
 
virtual int handle_close (ACE_HANDLE handle, ACE_Reactor_Mask close_mask)
 
virtual int handle_signal (int signum, siginfo_t *=0, ucontext_t *=0)
 
virtual int resume_handler (void)
 
virtual int handle_qos (ACE_HANDLE=ACE_INVALID_HANDLE)
 
virtual int handle_group_qos (ACE_HANDLE=ACE_INVALID_HANDLE)
 
virtual void reactor (ACE_Reactor *reactor)
 
virtual ACE_Reactorreactor (void) const
 
virtual ACE_Reactor_Timer_Interfacereactor_timer_interface (void) const
 
Reference_Counting_Policyreference_counting_policy (void)
 
- 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

ACE_Thread_Mutex mutex_
 
bool active_
 
bool scheduled_
 
ImplsType impls_
 
CORBA::ULong blob_index_
 
AssociationData data_
 
TransportImpl::ConnectionAttribs attribs_
 
WeakRcHandle< TransportClientclient_
 
- Public Attributes inherited from ACE_Event_Handler
 LO_PRIORITY
 
 HI_PRIORITY
 
 NULL_MASK
 
 READ_MASK
 
 WRITE_MASK
 
 EXCEPT_MASK
 
 ACCEPT_MASK
 
 CONNECT_MASK
 
 TIMER_MASK
 
 QOS_MASK
 
 GROUP_QOS_MASK
 
 SIGNAL_MASK
 
 ALL_EVENTS_MASK
 
 RWE_MASK
 
 DONT_CALL
 
 ACE_EVENT_HANDLER_NOT_RESUMED
 
 ACE_REACTOR_RESUMES_HANDLER
 
 ACE_APPLICATION_RESUMES_HANDLER
 

Additional Inherited Members

- Public Types inherited from ACE_Event_Handler
typedef long Reference_Count
 
- Static Public Member Functions inherited from ACE_Event_Handler
static ACE_THR_FUNC_RETURN read_adapter (void *event_handler)
 
static int register_stdin_handler (ACE_Event_Handler *eh, ACE_Reactor *reactor, ACE_Thread_Manager *thr_mgr, int flags=THR_DETACHED)
 
static int remove_stdin_handler (ACE_Reactor *reactor, ACE_Thread_Manager *thr_mgr)
 
- Protected Types inherited from ACE_Event_Handler
typedef ACE_Atomic_Op< ACE_SYNCH_MUTEX, Reference_CountAtomic_Reference_Count
 
- Protected Member Functions inherited from ACE_Event_Handler
 ACE_Event_Handler (ACE_Reactor *=0, int priority=ACE_Event_Handler::LO_PRIORITY)
 
- Protected Member Functions inherited from OpenDDS::DCPS::RcObject
 RcObject ()
 
- Protected Attributes inherited from ACE_Event_Handler
Atomic_Reference_Count reference_count_
 

Detailed Description

Definition at line 200 of file TransportClient.h.

Constructor & Destructor Documentation

◆ PendingAssoc()

OpenDDS::DCPS::TransportClient::PendingAssoc::PendingAssoc ( RcHandle< TransportClient tc_rch)
inlineexplicit

Definition at line 209 of file TransportClient.h.

References time().

Member Function Documentation

◆ handle_timeout()

int OpenDDS::DCPS::TransportClient::PendingAssoc::handle_timeout ( const ACE_Time_Value time,
const void *  arg 
)
virtual

Reimplemented from ACE_Event_Handler.

Definition at line 365 of file TransportClient.cpp.

References TheServiceParticipant.

367 {
368  ThreadStatusManager::Event ev(TheServiceParticipant->get_thread_status_manager());
369 
370  RcHandle<TransportClient> client;
371  {
373  client = client_.lock();
374  scheduled_ = false;
375  }
376 
377  if (client && client.get() == static_cast<TransportClient*>(const_cast<void*>(arg))) {
378  client->use_datalink(data_.remote_id_, DataLink_rch());
379  }
380  return 0;
381 }
WeakRcHandle< TransportClient > client_
RcHandle< DataLink > DataLink_rch
The type definition for the smart-pointer to the underlying type.
Definition: DataLink_rch.h:34
RcHandle< T > lock() const
Definition: RcObject.h:188
#define TheServiceParticipant

◆ initiate_connect()

bool OpenDDS::DCPS::TransportClient::PendingAssoc::initiate_connect ( TransportClient tc,
Guard guard 
)

Definition at line 439 of file TransportClient.cpp.

References ACE_GUARD_RETURN, ACE_TEXT(), OpenDDS::DCPS::LogGuid::c_str(), OpenDDS::DCPS::TransportClient::impls_, OpenDDS::DCPS::TransportClient::initiate_connect_i(), OpenDDS::DCPS::RcHandle< T >::is_nil(), OpenDDS::DCPS::TransportImpl::AcceptConnectResult::link_, LM_DEBUG, OPENDDS_STRING, OpenDDS::DCPS::TransportImpl::RemoteTransport::participant_discovered_at_, OpenDDS::DCPS::TransportClient::repo_id_, OpenDDS::DCPS::TransportImpl::AcceptConnectResult::success_, OpenDDS::DCPS::TransportImpl::transport_type(), OpenDDS::DCPS::TransportClient::use_datalink_i(), and VDBG_LVL.

Referenced by OpenDDS::DCPS::TransportClient::associate(), and OpenDDS::DCPS::TransportClient::use_datalink_i().

441 {
442  LogGuid local_log(tc->repo_id_);
443  LogGuid remote_log(data_.remote_id_);
444  VDBG_LVL((LM_DEBUG, "(%P|%t) PendingAssoc::initiate_connect - "
445  "between %C and remote %C\n",
446  local_log.c_str(),
447  remote_log.c_str()), 0);
448  // find the next impl / blob entry that have matching types
449  while (!impls_.empty()) {
450  TransportImpl_rch impl = impls_.back().lock();
451  if (!impl) {
452  impls_.pop_back();
453  continue;
454  }
455  const OPENDDS_STRING type = impl->transport_type();
456 
457  for (; blob_index_ < data_.remote_data_.length(); ++blob_index_) {
458  if (data_.remote_data_[blob_index_].transport_type.in() == type) {
459  const TransportImpl::RemoteTransport remote_transport = {
463 
464  TransportImpl::AcceptConnectResult res;
465  bool ret;
466  {
467  // Release the PendingAssoc object's mutex_ since initiate_connect_i doesn't need it.
468  Reverse_Lock_t rev_mutex(mutex_);
469  ACE_GUARD_RETURN(Reverse_Lock_t, rev_pend_guard, rev_mutex, false);
470  ret = tc->initiate_connect_i(res, impl, remote_transport, attribs_, guard);
471  }
472  if (!ret) {
473  //tc init connect returned false there is no PendingAssoc left in map because use_datalink_i finished elsewhere
474  //so don't do anything further with pend and return success or failure up to tc's associate
475  if (res.success_ ) {
476  VDBG_LVL((LM_DEBUG, ACE_TEXT("(%P|%t) PendingAssoc::initiate_connect - ")
477  ACE_TEXT("between %C and remote %C success\n"),
478  local_log.c_str(),
479  remote_log.c_str()), 0);
480  return true;
481  }
482 
483  VDBG_LVL((LM_DEBUG, "(%P|%t) PendingAssoc::initiate_connect - "
484  "between %C and remote %C unsuccessful\n",
485  local_log.c_str(),
486  remote_log.c_str()), 0);
487  }
488 
489  if (res.success_) {
490 
491  ++blob_index_;
492 
493  if (!res.link_.is_nil()) {
494 
495  {
496  // use_datalink_i calls PendingAssoc::reset_client which needs the PendingAssoc's mutex_.
497  Reverse_Lock_t rev_mutex(mutex_);
498  ACE_GUARD_RETURN(Reverse_Lock_t, rev_pend_guard, rev_mutex, false);
499  tc->use_datalink_i(data_.remote_id_, res.link_, guard);
500  }
501  } else {
502  VDBG_LVL((LM_DEBUG, "(%P|%t) PendingAssoc::intiate_connect - "
503  "resulting link from initiate_connect_i (local: %C to remote: %C) was nil\n",
504  local_log.c_str(),
505  remote_log.c_str()), 0);
506  }
507 
508  return true;
509  } else {
510  VDBG_LVL((LM_DEBUG, "(%P|%t) PendingAssoc::intiate_connect - "
511  "result of initiate_connect_i (local: %C to remote: %C) was not success\n",
512  local_log.c_str(),
513  remote_log.c_str()), 0);
514  }
515  }
516  }
517 
518  impls_.pop_back();
519  blob_index_ = 0;
520  }
521 
522  return false;
523 }
ACE_Reverse_Lock< ACE_Thread_Mutex > Reverse_Lock_t
RcHandle< TransportImpl > TransportImpl_rch
The type definition for the smart-pointer to the underlying type.
MonotonicTime_t participant_discovered_at_
TransportImpl::ConnectionAttribs attribs_
#define OPENDDS_STRING
ACE_CDR::ULong remote_transport_context_
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
ACE_TEXT("TCP_Factory")
#define VDBG_LVL(DBG_ARGS, LEVEL)
TransportLocatorSeq remote_data_
TransportLocator discovery_locator_

◆ reset_client()

void OpenDDS::DCPS::TransportClient::PendingAssoc::reset_client ( )

◆ safe_to_remove()

bool OpenDDS::DCPS::TransportClient::PendingAssoc::safe_to_remove ( )

Member Data Documentation

◆ active_

bool OpenDDS::DCPS::TransportClient::PendingAssoc::active_

◆ attribs_

TransportImpl::ConnectionAttribs OpenDDS::DCPS::TransportClient::PendingAssoc::attribs_

Definition at line 206 of file TransportClient.h.

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

◆ blob_index_

CORBA::ULong OpenDDS::DCPS::TransportClient::PendingAssoc::blob_index_

Definition at line 204 of file TransportClient.h.

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

◆ client_

WeakRcHandle<TransportClient> OpenDDS::DCPS::TransportClient::PendingAssoc::client_

Definition at line 207 of file TransportClient.h.

◆ data_

AssociationData OpenDDS::DCPS::TransportClient::PendingAssoc::data_

◆ impls_

ImplsType OpenDDS::DCPS::TransportClient::PendingAssoc::impls_

◆ mutex_

ACE_Thread_Mutex OpenDDS::DCPS::TransportClient::PendingAssoc::mutex_

◆ scheduled_

bool OpenDDS::DCPS::TransportClient::PendingAssoc::scheduled_

Definition at line 202 of file TransportClient.h.


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