OpenDDS  Snapshot(2023/04/28-20:55)
AssociationData.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #ifndef OPENDDS_DCPS_ASSOCIATIONDATA_H
9 #define OPENDDS_DCPS_ASSOCIATIONDATA_H
10 
11 #include "GuidUtils.h"
12 #include "NetworkResource.h"
13 #include "Time_Helper.h"
15 
16 #include <dds/DdsDcpsInfoUtilsC.h>
17 
18 #include <ace/INET_Addr.h>
19 
21 
22 namespace OpenDDS {
23 namespace DCPS {
24 
33 
35  : remote_id_(GUID_UNKNOWN)
36  , discovery_locator_()
37  , participant_discovered_at_(monotonic_time_zero())
38  , remote_transport_context_(0)
39  , publication_transport_priority_(0)
40  , remote_reliable_(false)
41  , remote_durable_(false)
42  {}
43 
45  {
46  ACE_INET_Addr remote_address;
47  NetworkResource network_resource;
48 
49  // Get the remote address from the "blob" in the remote_info struct.
50  ACE_InputCDR cdr((const char*)remote.get_buffer(),
51  remote.length());
52 
53  if ((cdr >> network_resource) == 0) {
55  ACE_TEXT("(%P|%t) ERROR: AssociationData::get_remote_address")
56  ACE_TEXT(" failed to de-serialize the NetworkResource\n")));
57  } else {
58  network_resource.to_addr(remote_address);
59  }
60 
61  return remote_address;
62  }
63 };
64 
65 } // namespace DCPS
66 } // namespace OpenDDS
67 
69 
70 #endif /* OPENDDS_DCPS_ASSOCIATIONDATA_H */
#define ACE_ERROR(X)
TransportLocatorSeq remote_data_
const GUID_t GUID_UNKNOWN
Nil value for GUID.
Definition: GuidUtils.h:59
MonotonicTime_t participant_discovered_at_
TransportLocator discovery_locator_
ACE_CDR::ULong remote_transport_context_
sequence< TransportLocator > TransportLocatorSeq
Defines a wrapper around address info which is used for advertise.
ACE_INLINE OpenDDS_Dcps_Export const MonotonicTime_t & monotonic_time_zero()
ACE_UINT32 ULong
ACE_TEXT("TCP_Factory")
ACE_CDR::Long Priority
static ACE_INET_Addr get_remote_address(const TransportBLOB &remote)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
void to_addr(ACE_INET_Addr &addr) const
DDS::OctetSeq TransportBLOB
LM_ERROR
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28