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 namespace OpenDDS {
00017 namespace DCPS {
00018 
00019 class MulticastDataLink;
00020 
00021 class OpenDDS_Multicast_Export MulticastSendStrategy
00022   : public TransportSendStrategy
00023 #if defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS)
00024   , public ACE_Handler {
00025 #else
00026   {
00027 #endif
00028 public:
00029   explicit MulticastSendStrategy(MulticastDataLink* link);
00030 
00031   virtual void stop_i();
00032 
00033 protected:
00034   virtual void prepare_header_i();
00035 
00036   virtual ssize_t send_bytes_i(const iovec iov[], int n);
00037   ssize_t sync_send(const iovec iov[], int n);
00038   ssize_t async_send(const iovec iov[], int n);
00039 
00040   virtual size_t max_message_size() const
00041   {
00042     return UDP_MAX_MESSAGE_SIZE;
00043   }
00044 
00045 #if defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS)
00046   // Callback from async send.
00047   virtual void handle_write_dgram(const ACE_Asynch_Write_Dgram::Result& res);
00048 #endif
00049 
00050 private:
00051   MulticastDataLink* link_;
00052 
00053 #if defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS)
00054   ACE_Asynch_Write_Dgram async_writer_;
00055   bool async_init_;
00056 #endif
00057 };
00058 
00059 } // namespace DCPS
00060 } // namespace OpenDDS
00061 
00062 #endif /* DCPS_MULTICASTSENDSTRATEGY_H */

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