OpenDDS  Snapshot(2023/04/28-20:55)
MulticastSendStrategy.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #ifndef OPENDDS_DCPS_TRANSPORT_MULTICAST_MULTICASTSENDSTRATEGY_H
9 #define OPENDDS_DCPS_TRANSPORT_MULTICAST_MULTICASTSENDSTRATEGY_H
10 
11 #include "Multicast_Export.h"
12 
14 #include "ace/Asynch_IO.h"
15 
17 
18 namespace OpenDDS {
19 namespace DCPS {
20 
21 class MulticastDataLink;
22 typedef RcHandle<MulticastDataLink> MulticastDataLink_rch;
24  : public TransportSendStrategy
25 #if defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS)
26  , public ACE_Handler {
27 #else
28  {
29 #endif
30 public:
32 
33  virtual void stop_i();
34 
35 protected:
36  virtual void prepare_header_i();
37 
38  virtual ssize_t send_bytes_i(const iovec iov[], int n);
39  ssize_t sync_send(const iovec iov[], int n);
40  ssize_t async_send(const iovec iov[], int n, const ACE_INET_Addr& addr);
41 
42  virtual size_t max_message_size() const
43  {
44  return UDP_MAX_MESSAGE_SIZE;
45  }
46 
47 #if defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS)
48  // Callback from async send.
49  virtual void handle_write_dgram(const ACE_Asynch_Write_Dgram::Result& res);
50 #endif
51 
52 private:
54 
55 #if defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS)
56  ACE_Asynch_Write_Dgram async_writer_;
57  bool async_init_;
58 #endif
59 };
60 
61 } // namespace DCPS
62 } // namespace OpenDDS
63 
65 
66 #endif /* DCPS_MULTICASTSENDSTRATEGY_H */
#define OpenDDS_Multicast_Export
int ssize_t
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
RcHandle< MulticastDataLink > MulticastDataLink_rch