OpenDDS::DCPS::MulticastInst Class Reference

#include <MulticastInst.h>

Inheritance diagram for OpenDDS::DCPS::MulticastInst:

Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::MulticastInst:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual int load (ACE_Configuration_Heap &cf, ACE_Configuration_Section_Key &sect)
virtual OPENDDS_STRING dump_to_str ()
 Diagnostic aid.
bool is_reliable () const
 Does the transport as configured support RELIABLE_RELIABILITY_QOS?
bool async_send () const
virtual size_t populate_locator (OpenDDS::DCPS::TransportLocator &trans_info) const
 Populate a transport locator sequence. Return the number of "locators.".

Public Attributes

bool default_to_ipv6_
u_short port_offset_
ACE_INET_Addr group_address_
std::string local_address_
bool reliable_
double syn_backoff_
ACE_Time_Value syn_interval_
ACE_Time_Value syn_timeout_
size_t nak_depth_
ACE_Time_Value nak_interval_
size_t nak_delay_intervals_
size_t nak_max_
ACE_Time_Value nak_timeout_
unsigned char ttl_
size_t rcv_buffer_size_
bool async_send_

Private Member Functions

 MulticastInst (const std::string &name)
void default_group_address (ACE_INET_Addr &group_address)
MulticastTransportnew_impl (const TransportInst_rch &inst)

Friends

class MulticastType

Detailed Description

Definition at line 24 of file MulticastInst.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::MulticastInst::MulticastInst ( const std::string &  name  )  [explicit, private]

Definition at line 49 of file MulticastInst.cpp.

References default_group_address(), DEFAULT_NAK_INTERVAL(), DEFAULT_NAK_TIMEOUT(), DEFAULT_SYN_INTERVAL(), DEFAULT_SYN_TIMEOUT(), nak_interval_, nak_timeout_, syn_interval_, and syn_timeout_.

00050   : TransportInst("multicast", name),
00051     default_to_ipv6_(DEFAULT_TO_IPV6),
00052     port_offset_(DEFAULT_PORT_OFFSET),
00053     reliable_(DEFAULT_RELIABLE),
00054     syn_backoff_(DEFAULT_SYN_BACKOFF),
00055     nak_depth_(DEFAULT_NAK_DEPTH),
00056     nak_delay_intervals_(DEFAULT_NAK_DELAY_INTERVALS),
00057     nak_max_(DEFAULT_NAK_MAX),
00058     ttl_(DEFAULT_TTL),
00059 #if defined (ACE_DEFAULT_MAX_SOCKET_BUFSIZ)
00060     rcv_buffer_size_(ACE_DEFAULT_MAX_SOCKET_BUFSIZ),
00061 #else
00062     // Use system default values.
00063     rcv_buffer_size_(0),
00064 #endif
00065     async_send_(DEFAULT_ASYNC_SEND)
00066 {
00067   default_group_address(this->group_address_);
00068 
00069   this->syn_interval_.msec(DEFAULT_SYN_INTERVAL);
00070   this->syn_timeout_.msec(DEFAULT_SYN_TIMEOUT);
00071 
00072   this->nak_interval_.msec(DEFAULT_NAK_INTERVAL);
00073   this->nak_timeout_.msec(DEFAULT_NAK_TIMEOUT);
00074 }


Member Function Documentation

bool OpenDDS::DCPS::MulticastInst::async_send (  )  const [inline]

Definition at line 114 of file MulticastInst.h.

00114 { return this->async_send_; }

void OpenDDS::DCPS::MulticastInst::default_group_address ( ACE_INET_Addr &  group_address  )  [private]

Definition at line 135 of file MulticastInst.cpp.

References DEFAULT_IPV4_GROUP_ADDRESS(), and DEFAULT_IPV6_GROUP_ADDRESS().

Referenced by load(), and MulticastInst().

00136 {
00137   if (this->default_to_ipv6_) {
00138     group_address.set(this->port_offset_, DEFAULT_IPV6_GROUP_ADDRESS);
00139   } else {
00140     group_address.set(this->port_offset_, DEFAULT_IPV4_GROUP_ADDRESS);
00141   }
00142 }

OPENDDS_STRING OpenDDS::DCPS::MulticastInst::dump_to_str (  )  [virtual]

Diagnostic aid.

Reimplemented from OpenDDS::DCPS::TransportInst.

Definition at line 151 of file MulticastInst.cpp.

References async_send_, default_to_ipv6_, OpenDDS::DCPS::TransportInst::dump_to_str(), OpenDDS::DCPS::TransportInst::formatNameForDump(), group_address_, local_address_, nak_delay_intervals_, nak_depth_, nak_interval_, nak_max_, nak_timeout_, OPENDDS_STRING, port_offset_, rcv_buffer_size_, reliable_, syn_backoff_, syn_interval_, and syn_timeout_.

00152 {
00153   std::ostringstream os;
00154   os << TransportInst::dump_to_str() << std::endl;
00155 
00156   os << formatNameForDump("group_address")       << this->group_address_.get_host_addr()
00157                                                            << ":" << this->group_address_.get_port_number() << std::endl;
00158   os << formatNameForDump("local_address")       << this->local_address_ << std::endl;
00159   os << formatNameForDump("default_to_ipv6")     << (this->default_to_ipv6_ ? "true" : "false") << std::endl;
00160   os << formatNameForDump("port_offset")         << this->port_offset_ << std::endl;
00161   os << formatNameForDump("reliable")            << (this->reliable_ ? "true" : "false") << std::endl;
00162   os << formatNameForDump("syn_backoff")         << this->syn_backoff_ << std::endl;
00163   os << formatNameForDump("syn_interval")        << this->syn_interval_.msec() << std::endl;
00164   os << formatNameForDump("syn_timeout")         << this->syn_timeout_.msec() << std::endl;
00165   os << formatNameForDump("nak_depth")           << this->nak_depth_ << std::endl;
00166   os << formatNameForDump("nak_interval")        << this->nak_interval_.msec() << std::endl;
00167   os << formatNameForDump("nak_delay_intervals") << this->nak_delay_intervals_ << std::endl;
00168   os << formatNameForDump("nak_max")             << this->nak_max_ << std::endl;
00169   os << formatNameForDump("nak_timeout")         << this->nak_timeout_.msec() << std::endl;
00170   os << formatNameForDump("ttl")                 << int(this->ttl_) << std::endl;
00171   os << formatNameForDump("rcv_buffer_size");
00172 
00173   if (this->rcv_buffer_size_ == 0) {
00174     os << "System Default Value" << std::endl;
00175   } else {
00176     os << this->rcv_buffer_size_ << std::endl;
00177   }
00178 
00179   os << formatNameForDump("async_send");
00180 
00181 #if defined (ACE_WIN32) && defined (ACE_HAS_WIN32_OVERLAPPED_IO)
00182   os << (this->async_send_ ? "true" : "false") << std::endl;
00183 #else
00184   os << "Not Supported on this Platform" << std::endl;
00185 #endif
00186   return OPENDDS_STRING(os.str());
00187 }

bool OpenDDS::DCPS::MulticastInst::is_reliable (  )  const [inline, virtual]

Does the transport as configured support RELIABLE_RELIABILITY_QOS?

Implements OpenDDS::DCPS::TransportInst.

Definition at line 112 of file MulticastInst.h.

00112 { return this->reliable_; }

int OpenDDS::DCPS::MulticastInst::load ( ACE_Configuration_Heap &  cf,
ACE_Configuration_Section_Key &  sect 
) [virtual]

Overwrite the default configurations with the configuration from the given section in the ACE_Configuration_Heap object.

Reimplemented from OpenDDS::DCPS::TransportInst.

Definition at line 77 of file MulticastInst.cpp.

References default_group_address(), GET_CONFIG_STRING_VALUE, GET_CONFIG_TIME_VALUE, GET_CONFIG_TSTRING_VALUE, GET_CONFIG_VALUE, group_address_, and load.

00079 {
00080   TransportInst::load(cf, sect); // delegate to parent
00081 
00082   GET_CONFIG_VALUE(cf, sect, ACE_TEXT("default_to_ipv6"),
00083                    this->default_to_ipv6_, bool)
00084 
00085   GET_CONFIG_VALUE(cf, sect, ACE_TEXT("port_offset"),
00086                    this->port_offset_, u_short)
00087 
00088   ACE_TString group_address_s;
00089   GET_CONFIG_TSTRING_VALUE(cf, sect, ACE_TEXT("group_address"),
00090                            group_address_s)
00091   if (group_address_s.is_empty()) {
00092     // TODO: Passing 0 instead of transport id.  Does this cause complications?
00093     default_group_address(this->group_address_);
00094   } else {
00095     this->group_address_.set(group_address_s.c_str());
00096   }
00097 
00098   GET_CONFIG_STRING_VALUE(cf, sect, ACE_TEXT("local_address"),
00099                           this->local_address_);
00100 
00101   GET_CONFIG_VALUE(cf, sect, ACE_TEXT("reliable"), this->reliable_, bool)
00102 
00103   GET_CONFIG_VALUE(cf, sect, ACE_TEXT("syn_backoff"),
00104                    this->syn_backoff_, double)
00105 
00106   GET_CONFIG_TIME_VALUE(cf, sect, ACE_TEXT("syn_interval"), this->syn_interval_)
00107 
00108   GET_CONFIG_TIME_VALUE(cf, sect, ACE_TEXT("syn_timeout"), this->syn_timeout_)
00109 
00110   GET_CONFIG_VALUE(cf, sect, ACE_TEXT("nak_depth"),
00111                    this->nak_depth_, size_t)
00112 
00113   GET_CONFIG_TIME_VALUE(cf, sect, ACE_TEXT("nak_interval"), this->nak_interval_)
00114 
00115   GET_CONFIG_VALUE(cf, sect, ACE_TEXT("nak_delay_intervals"),
00116                         this->nak_delay_intervals_, size_t)
00117 
00118   GET_CONFIG_VALUE(cf, sect, ACE_TEXT("nak_max"), this->nak_max_, size_t)
00119 
00120   GET_CONFIG_TIME_VALUE(cf, sect, ACE_TEXT("nak_timeout"), this->nak_timeout_)
00121 
00122   GET_CONFIG_VALUE(cf, sect, ACE_TEXT("ttl"), this->ttl_, unsigned char)
00123 
00124   GET_CONFIG_VALUE(cf, sect, ACE_TEXT("rcv_buffer_size"),
00125                    this->rcv_buffer_size_, size_t)
00126 
00127 #if defined (ACE_WIN32) && defined (ACE_HAS_WIN32_OVERLAPPED_IO)
00128   GET_CONFIG_VALUE(cf, sect, ACE_TEXT("async_send"), this->async_send_, bool)
00129 #endif
00130 
00131   return 0;
00132 }

MulticastTransport * OpenDDS::DCPS::MulticastInst::new_impl ( const TransportInst_rch inst  )  [private]

Definition at line 145 of file MulticastInst.cpp.

00146 {
00147   return new MulticastTransport(inst);
00148 }

size_t OpenDDS::DCPS::MulticastInst::populate_locator ( OpenDDS::DCPS::TransportLocator trans_info  )  const [virtual]

Populate a transport locator sequence. Return the number of "locators.".

Implements OpenDDS::DCPS::TransportInst.

Definition at line 190 of file MulticastInst.cpp.

References OpenDDS::DCPS::TransportLocator::data, and OpenDDS::DCPS::TransportLocator::transport_type.

00191 {
00192   if (this->group_address_ != ACE_INET_Addr()) {
00193     NetworkAddress network_address(this->group_address_);
00194 
00195     ACE_OutputCDR cdr;
00196     cdr << network_address;
00197     cdr << ACE_OutputCDR::from_boolean (ACE_CDR::Boolean (this->is_reliable ()));
00198 
00199     const CORBA::ULong len = static_cast<CORBA::ULong>(cdr.total_length());
00200     char* buffer = const_cast<char*>(cdr.buffer()); // safe
00201 
00202     info.transport_type = "multicast";
00203     info.data = TransportBLOB(len, len, reinterpret_cast<CORBA::Octet*>(buffer));
00204     return 1;
00205   } else {
00206     return 0;
00207   }
00208 }


Friends And Related Function Documentation

friend class MulticastType [friend]

Definition at line 119 of file MulticastInst.h.


Member Data Documentation

bool OpenDDS::DCPS::MulticastInst::async_send_

Sending using asynchronous I/O on Windows platforms that support it. The default value is: false. This parameter has no effect on non-Windows platforms and Windows platforms that don't support asynchronous I/O.

Definition at line 104 of file MulticastInst.h.

Referenced by dump_to_str().

bool OpenDDS::DCPS::MulticastInst::default_to_ipv6_

Enables IPv6 default group address selection. The default value is: false.

Definition at line 29 of file MulticastInst.h.

Referenced by dump_to_str().

ACE_INET_Addr OpenDDS::DCPS::MulticastInst::group_address_

The multicast group to join to send/receive data. The default value is: 224.0.0.128:<port> [IANA 2009-11-17], or [FF01::80]:<port> [IANA 2009-08-28]

Definition at line 39 of file MulticastInst.h.

Referenced by dump_to_str(), and load().

std::string OpenDDS::DCPS::MulticastInst::local_address_

If non-empty, the address to pass to ACE which indicates the local network interface which should be used for joining the multicast group.

Definition at line 44 of file MulticastInst.h.

Referenced by dump_to_str(), and OpenDDS::DCPS::MulticastDataLink::join().

size_t OpenDDS::DCPS::MulticastInst::nak_delay_intervals_

The number of interval's between nak's for a sample (after initial nak). The default value is: 4.

Definition at line 79 of file MulticastInst.h.

Referenced by dump_to_str(), and OpenDDS::DCPS::ReliableSession::send_naks().

size_t OpenDDS::DCPS::MulticastInst::nak_depth_

The number of datagrams to retain in order to service repair requests (reliable only). The default value is: 32.

Definition at line 69 of file MulticastInst.h.

Referenced by dump_to_str().

ACE_Time_Value OpenDDS::DCPS::MulticastInst::nak_interval_

The minimum number of milliseconds to wait between repair requests (reliable only). The default value is: 500.

Definition at line 74 of file MulticastInst.h.

Referenced by dump_to_str(), MulticastInst(), and OpenDDS::DCPS::NakWatchdog::next_interval().

size_t OpenDDS::DCPS::MulticastInst::nak_max_

The maximum number of a missing sample will be nak'ed. The default value is: 3.

Definition at line 83 of file MulticastInst.h.

Referenced by dump_to_str(), and OpenDDS::DCPS::ReliableSession::send_naks().

ACE_Time_Value OpenDDS::DCPS::MulticastInst::nak_timeout_

The maximum number of milliseconds to wait before giving up on a repair response (reliable only). The default value is: 30000 (30 seconds).

Definition at line 88 of file MulticastInst.h.

Referenced by dump_to_str(), OpenDDS::DCPS::ReliableSession::expire_naks(), and MulticastInst().

u_short OpenDDS::DCPS::MulticastInst::port_offset_

The default port number (when group_address is not set) The default value is: 49152 [IANA 2009-11-16].

Definition at line 33 of file MulticastInst.h.

Referenced by dump_to_str().

size_t OpenDDS::DCPS::MulticastInst::rcv_buffer_size_

The size of the socket receive buffer. The default value is: ACE_DEFAULT_MAX_SOCKET_BUFSIZ if it's defined, otherwise, 0. If the value is 0, the system default value is used.

Definition at line 98 of file MulticastInst.h.

Referenced by dump_to_str(), and OpenDDS::DCPS::MulticastDataLink::join().

bool OpenDDS::DCPS::MulticastInst::reliable_

Enables reliable communication. This option will eventually be deprecated. The default value is: true.

Definition at line 49 of file MulticastInst.h.

Referenced by dump_to_str().

double OpenDDS::DCPS::MulticastInst::syn_backoff_

The exponential base used during handshake retries; smaller values yield shorter delays between attempts. The default value is: 2.0.

Definition at line 54 of file MulticastInst.h.

Referenced by dump_to_str(), and OpenDDS::DCPS::SynWatchdog::next_interval().

ACE_Time_Value OpenDDS::DCPS::MulticastInst::syn_interval_

The minimum number of milliseconds to wait between handshake attempts during association. The default value is: 250.

Definition at line 59 of file MulticastInst.h.

Referenced by dump_to_str(), MulticastInst(), and OpenDDS::DCPS::SynWatchdog::next_interval().

ACE_Time_Value OpenDDS::DCPS::MulticastInst::syn_timeout_

The maximum number of milliseconds to wait before giving up on a handshake response during association. The default value is: 30000 (30 seconds).

Definition at line 64 of file MulticastInst.h.

Referenced by dump_to_str(), MulticastInst(), and OpenDDS::DCPS::SynWatchdog::next_timeout().

unsigned char OpenDDS::DCPS::MulticastInst::ttl_

time-to-live. The default value is: 1 (in same subnet)

Definition at line 92 of file MulticastInst.h.


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