00001 /* 00002 * 00003 * 00004 * Distributed under the OpenDDS License. 00005 * See: http://www.opendds.org/license.html 00006 */ 00007 00008 #ifndef DCPS_MULTICASTINST_H 00009 #define DCPS_MULTICASTINST_H 00010 00011 #include "Multicast_Export.h" 00012 #include "MulticastTransport.h" 00013 00014 #include "ace/INET_Addr.h" 00015 #include "ace/Time_Value.h" 00016 00017 #include "dds/DCPS/transport/framework/TransportInst.h" 00018 00019 #include <string> 00020 00021 namespace OpenDDS { 00022 namespace DCPS { 00023 00024 class OpenDDS_Multicast_Export MulticastInst 00025 : public TransportInst { 00026 public: 00027 /// Enables IPv6 default group address selection. 00028 /// The default value is: false. 00029 bool default_to_ipv6_; 00030 00031 /// The default port number (when group_address is not set) 00032 /// The default value is: 49152 [IANA 2009-11-16]. 00033 u_short port_offset_; 00034 00035 /// The multicast group to join to send/receive data. 00036 /// The default value is: 00037 /// 224.0.0.128:<port> [IANA 2009-11-17], or 00038 /// [FF01::80]:<port> [IANA 2009-08-28] 00039 ACE_INET_Addr group_address_; 00040 00041 /// If non-empty, the address to pass to ACE which indicates the 00042 /// local network interface which should be used for joining the 00043 /// multicast group. 00044 std::string local_address_; 00045 00046 /// Enables reliable communication. This option will eventually 00047 /// be deprecated. 00048 /// The default value is: true. 00049 bool reliable_; 00050 00051 /// The exponential base used during handshake retries; smaller 00052 /// values yield shorter delays between attempts. 00053 /// The default value is: 2.0. 00054 double syn_backoff_; 00055 00056 /// The minimum number of milliseconds to wait between handshake 00057 /// attempts during association. 00058 /// The default value is: 250. 00059 ACE_Time_Value syn_interval_; 00060 00061 /// The maximum number of milliseconds to wait before giving up 00062 /// on a handshake response during association. 00063 /// The default value is: 30000 (30 seconds). 00064 ACE_Time_Value syn_timeout_; 00065 00066 /// The number of datagrams to retain in order to service repair 00067 /// requests (reliable only). 00068 /// The default value is: 32. 00069 size_t nak_depth_; 00070 00071 /// The minimum number of milliseconds to wait between repair 00072 /// requests (reliable only). 00073 /// The default value is: 500. 00074 ACE_Time_Value nak_interval_; 00075 00076 /// The number of interval's between nak's for a sample 00077 /// (after initial nak). 00078 /// The default value is: 4. 00079 size_t nak_delay_intervals_; 00080 00081 /// The maximum number of a missing sample will be nak'ed. 00082 /// The default value is: 3. 00083 size_t nak_max_; 00084 00085 /// The maximum number of milliseconds to wait before giving up 00086 /// on a repair response (reliable only). 00087 /// The default value is: 30000 (30 seconds). 00088 ACE_Time_Value nak_timeout_; 00089 00090 /// time-to-live. 00091 /// The default value is: 1 (in same subnet) 00092 unsigned char ttl_; 00093 00094 /// The size of the socket receive buffer. 00095 /// The default value is: ACE_DEFAULT_MAX_SOCKET_BUFSIZ if it's defined, 00096 /// otherwise, 0. 00097 /// If the value is 0, the system default value is used. 00098 size_t rcv_buffer_size_; 00099 00100 /// Sending using asynchronous I/O on Windows platforms that support it. 00101 /// The default value is: false. 00102 /// This parameter has no effect on non-Windows platforms and Windows platforms 00103 /// that don't support asynchronous I/O. 00104 bool async_send_; 00105 00106 virtual int load(ACE_Configuration_Heap& cf, 00107 ACE_Configuration_Section_Key& sect); 00108 00109 /// Diagnostic aid. 00110 virtual OPENDDS_STRING dump_to_str(); 00111 00112 bool is_reliable() const { return this->reliable_; } 00113 00114 bool async_send() const { return this->async_send_; } 00115 00116 virtual size_t populate_locator(OpenDDS::DCPS::TransportLocator& trans_info) const; 00117 00118 private: 00119 friend class MulticastType; 00120 explicit MulticastInst(const std::string& name); 00121 00122 void default_group_address(ACE_INET_Addr& group_address); 00123 00124 MulticastTransport* new_impl(const TransportInst_rch& inst); 00125 }; 00126 00127 } // namespace DCPS 00128 } // namespace OpenDDS 00129 00130 #endif /* DCPS_MULTICASTINST_H */