OpenDDS  Snapshot(2023/04/28-20:55)
MulticastInst.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_TRANSPORT_MULTICAST_MULTICASTINST_H
9 #define OPENDDS_DCPS_TRANSPORT_MULTICAST_MULTICASTINST_H
10 
11 #include "Multicast_Export.h"
12 #include "MulticastTransport.h"
13 
14 #include "ace/INET_Addr.h"
15 #include "ace/Time_Value.h"
16 
18 
19 #include <string>
20 
22 
23 namespace OpenDDS {
24 namespace DCPS {
25 
27  : public TransportInst {
28 public:
29 
30  static const size_t DEFAULT_NAK_DEPTH = 32u;
31  static const long DEFAULT_NAK_INTERVAL = 500;
32  static const long DEFAULT_NAK_DELAY_INTERVALS = 4;
33  static const long DEFAULT_NAK_MAX = 3;
34  static const long DEFAULT_NAK_TIMEOUT = 30000;
35 
36  /// Enables IPv6 default group address selection.
37  /// The default value is: false.
39 
40  /// The default port number (when group_address is not set)
41  /// The default value is: 49152 [IANA 2009-11-16].
42  u_short port_offset_;
43 
44  /// The multicast group to join to send/receive data.
45  /// The default value is:
46  /// 224.0.0.128:<port> [IANA 2009-11-17], or
47  /// [FF01::80]:<port> [IANA 2009-08-28]
49 
50  /// If non-empty, the address to pass to ACE which indicates the
51  /// local network interface which should be used for joining the
52  /// multicast group.
53  std::string local_address_;
54 
55  /// Enables reliable communication. This option will eventually
56  /// be deprecated.
57  /// The default value is: true.
58  bool reliable_;
59 
60  /// The exponential base used during handshake retries; smaller
61  /// values yield shorter delays between attempts.
62  /// The default value is: 2.0.
63  double syn_backoff_;
64 
65  /// The minimum number of milliseconds to wait between handshake
66  /// attempts during association.
67  /// The default value is: 250.
69 
70  /// The maximum number of milliseconds to wait before giving up
71  /// on a handshake response during association.
72  /// The default value is: 30000 (30 seconds).
74 
75  /// The number of datagrams to retain in order to service repair
76  /// requests (reliable only).
77  /// The default value is: 32.
78  size_t nak_depth_;
79 
80  /// The minimum number of milliseconds to wait between repair
81  /// requests (reliable only).
82  /// The default value is: 500.
84 
85  /// The number of interval's between nak's for a sample
86  /// (after initial nak).
87  /// The default value is: 4.
89 
90  /// The maximum number of a missing sample will be nak'ed.
91  /// The default value is: 3.
92  size_t nak_max_;
93 
94  /// The maximum number of milliseconds to wait before giving up
95  /// on a repair response (reliable only).
96  /// The default value is: 30000 (30 seconds).
98 
99  /// time-to-live.
100  /// The default value is: 1 (in same subnet)
101  unsigned char ttl_;
102 
103  /// The size of the socket receive buffer.
104  /// The default value is: ACE_DEFAULT_MAX_SOCKET_BUFSIZ if it's defined,
105  /// otherwise, 0.
106  /// If the value is 0, the system default value is used.
108 
109  /// Sending using asynchronous I/O on Windows platforms that support it.
110  /// The default value is: false.
111  /// This parameter has no effect on non-Windows platforms and Windows platforms
112  /// that don't support asynchronous I/O.
114 
115  virtual int load(ACE_Configuration_Heap& cf,
117 
118  /// Diagnostic aid.
119  virtual OPENDDS_STRING dump_to_str() const;
120 
121  bool is_reliable() const { return this->reliable_; }
122 
123  bool async_send() const { return this->async_send_; }
124 
125  virtual size_t populate_locator(OpenDDS::DCPS::TransportLocator& trans_info, ConnectionInfoFlags flags) const;
126 
127 private:
128  friend class MulticastType;
129  template <typename T, typename U>
130  friend RcHandle<T> OpenDDS::DCPS::make_rch(U const&);
131  explicit MulticastInst(const std::string& name);
132 
133  void default_group_address(ACE_INET_Addr& group_address);
134 
135  TransportImpl_rch new_impl();
136 };
137 
138 } // namespace DCPS
139 } // namespace OpenDDS
140 
142 
143 #endif /* DCPS_MULTICASTINST_H */
static int load
Base class to hold configuration settings for TransportImpls.
Definition: TransportInst.h:64
RcHandle< T > make_rch()
Definition: RcHandle_T.h:256
bool is_reliable() const
Does the transport as configured support RELIABLE_RELIABILITY_QOS?
#define OpenDDS_Multicast_Export
#define OPENDDS_STRING
const char *const name
Definition: debug.cpp:60
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
size_t ConnectionInfoFlags