MulticastSendStrategy.h

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 #ifndef DCPS_MULTICASTSENDSTRATEGY_H
00009 #define DCPS_MULTICASTSENDSTRATEGY_H
00010 
00011 #include "Multicast_Export.h"
00012 
00013 #include "dds/DCPS/transport/framework/TransportSendStrategy.h"
00014 #include "ace/Asynch_IO.h"
00015 
00016 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00017 
00018 namespace OpenDDS {
00019 namespace DCPS {
00020 
00021 class MulticastDataLink;
00022 typedef RcHandle<MulticastDataLink> MulticastDataLink_rch;
00023 class OpenDDS_Multicast_Export MulticastSendStrategy
00024   : public TransportSendStrategy
00025 #if defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS)
00026   , public ACE_Handler {
00027 #else
00028   {
00029 #endif
00030 public:
00031   MulticastSendStrategy(MulticastDataLink* link);
00032 
00033   virtual void stop_i();
00034 
00035 protected:
00036   virtual void prepare_header_i();
00037 
00038   virtual ssize_t send_bytes_i(const iovec iov[], int n);
00039   ssize_t sync_send(const iovec iov[], int n);
00040   ssize_t async_send(const iovec iov[], int n);
00041 
00042   virtual size_t max_message_size() const
00043   {
00044     return UDP_MAX_MESSAGE_SIZE;
00045   }
00046 
00047 #if defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS)
00048   // Callback from async send.
00049   virtual void handle_write_dgram(const ACE_Asynch_Write_Dgram::Result& res);
00050 #endif
00051 
00052 private:
00053   MulticastDataLink* link_;
00054 
00055 #if defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS)
00056   ACE_Asynch_Write_Dgram async_writer_;
00057   bool async_init_;
00058 #endif
00059 };
00060 
00061 } // namespace DCPS
00062 } // namespace OpenDDS
00063 
00064 OPENDDS_END_VERSIONED_NAMESPACE_DECL
00065 
00066 #endif /* DCPS_MULTICASTSENDSTRATEGY_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1