TransportInst.inl

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 #include "TransportDefs.h"
00009 #include "EntryExit.h"
00010 
00011 
00012 ACE_INLINE
00013 OpenDDS::DCPS::TransportInst::TransportInst(const char* type,
00014                                             const OPENDDS_STRING& name)
00015   : transport_type_(type),
00016     queue_messages_per_pool_(DEFAULT_CONFIG_QUEUE_MESSAGES_PER_POOL),
00017     queue_initial_pools_(DEFAULT_CONFIG_QUEUE_INITIAL_POOLS),
00018     max_packet_size_(DEFAULT_CONFIG_MAX_PACKET_SIZE),
00019     max_samples_per_packet_(DEFAULT_CONFIG_MAX_SAMPLES_PER_PACKET),
00020     optimum_packet_size_(DEFAULT_CONFIG_OPTIMUM_PACKET_SIZE),
00021     thread_per_connection_(0),
00022     datalink_release_delay_(10000),
00023     datalink_control_chunks_(32),
00024     name_(name)
00025 {
00026   DBG_ENTRY_LVL("TransportInst", "TransportInst", 6);
00027   this->adjust_config_value();
00028 }
00029 
00030 ACE_INLINE
00031 void
00032 OpenDDS::DCPS::TransportInst::adjust_config_value()
00033 {
00034   // Ensure that the number of samples put into the packet does
00035   // not exceed the allowed number of io vectors to be sent by the OS.
00036   size_t old_value = max_samples_per_packet_;
00037 
00038   if ((2 * max_samples_per_packet_ + 1) > MAX_SEND_BLOCKS) {
00039     max_samples_per_packet_ = (MAX_SEND_BLOCKS + 1) / 2 - 1;
00040     ACE_DEBUG((LM_NOTICE,
00041                ACE_TEXT("(%P|%t) NOTICE: \"max_samples_per_packet\" is adjusted from %u to %u\n"),
00042                old_value, max_samples_per_packet_));
00043   }
00044 }

Generated on Fri Feb 12 20:05:28 2016 for OpenDDS by  doxygen 1.4.7