OpenDDS  Snapshot(2023/04/28-20:55)
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 367 of file TransportClient.cpp.

References TheServiceParticipant.

369 {
370  ThreadStatusManager::Event ev(TheServiceParticipant->get_thread_status_manager());
371 
372  RcHandle<TransportClient> client;
373  {
375  client = client_.lock();
376  scheduled_ = false;
377  }
378 
379  if (client && client.get() == static_cast<TransportClient*>(const_cast<void*>(arg))) {
380  client->use_datalink(data_.remote_id_, DataLink_rch());
381  }
382  return 0;
383 }
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 441 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().

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

◆ 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: