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]

List of all members.

Public Member Functions

 PendingAssoc ()
bool initiate_connect (TransportClient *tc, Guard &guard)
int handle_timeout (const ACE_Time_Value &time, const void *arg)

Public Attributes

bool active_
bool removed_
ImplsType impls_
CORBA::ULong blob_index_
AssociationData data_
TransportImpl::ConnectionAttribs attribs_

Detailed Description

Definition at line 171 of file TransportClient.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::TransportClient::PendingAssoc::PendingAssoc (  )  [inline]

Definition at line 178 of file TransportClient.h.

00179       : active_(false)
00180       , removed_(false)
00181       , blob_index_(0)
00182     {}


Member Function Documentation

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

Reimplemented from ACE_Event_Handler.

Definition at line 299 of file TransportClient.cpp.

References data_, OpenDDS::DCPS::AssociationData::remote_id_, and OpenDDS::DCPS::TransportClient::use_datalink().

00301 {
00302   TransportClient* tc = static_cast<TransportClient*>(const_cast<void*>(arg));
00303 
00304   tc->use_datalink(data_.remote_id_, DataLink_rch());
00305 
00306   return 0;
00307 }

Here is the call graph for this function:

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

Definition at line 361 of file TransportClient.cpp.

References ACE_TEXT(), attribs_, blob_index_, data_, impls_, OpenDDS::DCPS::TransportClient::initiate_connect_i(), OpenDDS::DCPS::RcHandle< T >::is_nil(), OpenDDS::DCPS::TransportImpl::AcceptConnectResult::link_, LM_DEBUG, OPENDDS_STRING, OpenDDS::DCPS::AssociationData::publication_transport_priority_, OpenDDS::DCPS::AssociationData::remote_data_, OpenDDS::DCPS::AssociationData::remote_durable_, OpenDDS::DCPS::AssociationData::remote_id_, OpenDDS::DCPS::AssociationData::remote_reliable_, OpenDDS::DCPS::TransportClient::repo_id_, OpenDDS::DCPS::TransportImpl::AcceptConnectResult::success_, OpenDDS::DCPS::TransportImpl::transport_type(), OpenDDS::DCPS::TransportClient::use_datalink_i(), and VDBG_LVL.

00363 {
00364   GuidConverter local(tc->repo_id_);
00365   GuidConverter remote(data_.remote_id_);
00366   VDBG_LVL((LM_DEBUG, "(%P|%t) PendingAssoc::initiate_connect - "
00367                       "between %C and remote %C\n",
00368                       OPENDDS_STRING(local).c_str(),
00369                       OPENDDS_STRING(remote).c_str()), 0);
00370   // find the next impl / blob entry that have matching types
00371   while (!impls_.empty()) {
00372     TransportImpl* impl = impls_.back();
00373     const OPENDDS_STRING type = impl->transport_type();
00374 
00375     for (; blob_index_ < data_.remote_data_.length(); ++blob_index_) {
00376       if (data_.remote_data_[blob_index_].transport_type.in() == type) {
00377         const TransportImpl::RemoteTransport remote = {
00378           data_.remote_id_, data_.remote_data_[blob_index_].data,
00379           data_.publication_transport_priority_,
00380           data_.remote_reliable_, data_.remote_durable_};
00381 
00382         TransportImpl::AcceptConnectResult res;
00383         GuidConverter tmp_local(tc->repo_id_);
00384         GuidConverter tmp_remote(data_.remote_id_);
00385         if (!tc->initiate_connect_i(res, impl, remote, attribs_, guard)) {
00386           //tc init connect returned false there is no PendingAssoc left in map because use_datalink_i finished elsewhere
00387           //so don't do anything further with pend and return success or failure up to tc's associate
00388           if (res.success_ ) {
00389             GuidConverter local(tc->repo_id_);
00390             GuidConverter remote(data_.remote_id_);
00391             VDBG_LVL((LM_DEBUG, ACE_TEXT("(%P|%t) PendingAssoc::initiate_connect - ")
00392                                 ACE_TEXT("between %C and remote %C success\n"),
00393                                 OPENDDS_STRING(local).c_str(),
00394                                 OPENDDS_STRING(remote).c_str()), 0);
00395             return true;
00396           }
00397 
00398           VDBG_LVL((LM_DEBUG, "(%P|%t) PendingAssoc::initiate_connect - "
00399                               "between %C and remote %C unsuccessful\n",
00400                               OPENDDS_STRING(tmp_local).c_str(),
00401                               OPENDDS_STRING(tmp_remote).c_str()), 0);
00402           break;
00403         }
00404 
00405         if (res.success_) {
00406 
00407           ++blob_index_;
00408 
00409           if (!res.link_.is_nil()) {
00410 
00411             tc->use_datalink_i(data_.remote_id_, res.link_, guard);
00412           } else {
00413             GuidConverter local(tc->repo_id_);
00414             GuidConverter remote(data_.remote_id_);
00415             VDBG_LVL((LM_DEBUG, "(%P|%t) PendingAssoc::intiate_connect - "
00416                                 "resulting link from initiate_connect_i (local: %C to remote: %C) was nil\n",
00417                                 OPENDDS_STRING(local).c_str(),
00418                                 OPENDDS_STRING(remote).c_str()), 0);
00419           }
00420 
00421           return true;
00422         } else {
00423           GuidConverter local(tc->repo_id_);
00424           GuidConverter remote(data_.remote_id_);
00425           VDBG_LVL((LM_DEBUG, "(%P|%t) PendingAssoc::intiate_connect - "
00426                               "result of initiate_connect_i (local: %C to remote: %C) was not success \n",
00427                               OPENDDS_STRING(local).c_str(),
00428                               OPENDDS_STRING(remote).c_str()), 0);
00429         }
00430       }
00431     }
00432 
00433     impls_.pop_back();
00434     blob_index_ = 0;
00435   }
00436 
00437   return false;
00438 }

Here is the call graph for this function:


Member Data Documentation

Definition at line 172 of file TransportClient.h.

Definition at line 176 of file TransportClient.h.

Referenced by initiate_connect().

Definition at line 174 of file TransportClient.h.

Referenced by initiate_connect().

Definition at line 175 of file TransportClient.h.

Referenced by handle_timeout(), and initiate_connect().

Definition at line 173 of file TransportClient.h.

Referenced by initiate_connect().

Definition at line 172 of file TransportClient.h.


The documentation for this struct was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1