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 167 of file TransportClient.h.


Constructor & Destructor Documentation

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

Definition at line 174 of file TransportClient.h.

00175       : active_(false), removed_(false), blob_index_(0)
00176     {}


Member Function Documentation

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

Definition at line 384 of file TransportClient.cpp.

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

00386 {
00387   TransportClient* tc = static_cast<TransportClient*>(const_cast<void*>(arg));
00388 
00389   tc->use_datalink(data_.remote_id_, 0);
00390 
00391   return 0;
00392 }

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

Definition at line 477 of file TransportClient.cpp.

References attribs_, blob_index_, data_, impls_, OpenDDS::DCPS::TransportClient::initiate_connect_i(), OpenDDS::DCPS::RcHandle< T >::is_nil(), OpenDDS::DCPS::TransportImpl::AcceptConnectResult::link_, 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::TransportClient::use_datalink_i(), and VDBG_LVL.

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

00479 {
00480   GuidConverter local(tc->repo_id_);
00481   GuidConverter remote(this->data_.remote_id_);
00482   VDBG_LVL((LM_DEBUG, "(%P|%t) PendingAssoc::initiate_connect - "
00483                       "between %C and remote %C\n",
00484                       OPENDDS_STRING(local).c_str(),
00485                       OPENDDS_STRING(remote).c_str()), 0);
00486   // find the next impl / blob entry that have matching types
00487   while (!impls_.empty()) {
00488     const TransportImpl_rch& impl = impls_.back();
00489     const OPENDDS_STRING type = impl->transport_type();
00490 
00491     for (; blob_index_ < data_.remote_data_.length(); ++blob_index_) {
00492       if (data_.remote_data_[blob_index_].transport_type.in() == type) {
00493         const TransportImpl::RemoteTransport remote = {
00494           data_.remote_id_, data_.remote_data_[blob_index_].data,
00495           data_.publication_transport_priority_,
00496           data_.remote_reliable_, data_.remote_durable_};
00497 
00498         TransportImpl::AcceptConnectResult res;
00499         GuidConverter tmp_local(tc->repo_id_);
00500         GuidConverter tmp_remote(this->data_.remote_id_);
00501         if (!tc->initiate_connect_i(res, impl, remote, attribs_, guard)) {
00502           //tc init connect returned false there is no PendingAssoc left in map because use_datalink_i finished elsewhere
00503           //so don't do anything further with pend and return success or failure up to tc's associate
00504           if (res.success_ && !this->removed_) {
00505             GuidConverter local(tc->repo_id_);
00506             GuidConverter remote(this->data_.remote_id_);
00507             VDBG_LVL((LM_DEBUG, ACE_TEXT("(%P|%t) PendingAssoc::initiate_connect - ")
00508                                 ACE_TEXT("between %C and remote %C success\n"),
00509                                 OPENDDS_STRING(local).c_str(),
00510                                 OPENDDS_STRING(remote).c_str()), 0);
00511             return true;
00512           }
00513 
00514           VDBG_LVL((LM_DEBUG, "(%P|%t) PendingAssoc::initiate_connect - "
00515                               "between %C and remote %C unsuccessful\n",
00516                               OPENDDS_STRING(tmp_local).c_str(),
00517                               OPENDDS_STRING(tmp_remote).c_str()), 0);
00518           return false;
00519         }
00520 
00521         if (res.success_) {
00522 
00523           ++blob_index_;
00524 
00525           if (!res.link_.is_nil()) {
00526 
00527             tc->use_datalink_i(data_.remote_id_, res.link_, guard);
00528           } else {
00529             GuidConverter local(tc->repo_id_);
00530             GuidConverter remote(this->data_.remote_id_);
00531             VDBG_LVL((LM_DEBUG, "(%P|%t) PendingAssoc::intiate_connect - "
00532                                 "resulting link from initiate_connect_i (local: %C to remote: %C) was nil\n",
00533                                 OPENDDS_STRING(local).c_str(),
00534                                 OPENDDS_STRING(remote).c_str()), 0);
00535           }
00536 
00537           return true;
00538         } else {
00539           GuidConverter local(tc->repo_id_);
00540           GuidConverter remote(this->data_.remote_id_);
00541           VDBG_LVL((LM_DEBUG, "(%P|%t) PendingAssoc::intiate_connect - "
00542                               "result of initiate_connect_i (local: %C to remote: %C) was not success \n",
00543                               OPENDDS_STRING(local).c_str(),
00544                               OPENDDS_STRING(remote).c_str()), 0);
00545         }
00546       }
00547     }
00548 
00549     impls_.pop_back();
00550     blob_index_ = 0;
00551   }
00552 
00553   return false;
00554 }


Member Data Documentation

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

Definition at line 168 of file TransportClient.h.

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

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

Definition at line 172 of file TransportClient.h.

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

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

Definition at line 170 of file TransportClient.h.

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

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

Definition at line 171 of file TransportClient.h.

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

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

Definition at line 169 of file TransportClient.h.

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

bool OpenDDS::DCPS::TransportClient::PendingAssoc::removed_

Definition at line 168 of file TransportClient.h.

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


The documentation for this struct was generated from the following files:
Generated on Fri Feb 12 20:06:29 2016 for OpenDDS by  doxygen 1.4.7