OpenDDS  Snapshot(2023/04/28-20:55)
MulticastManager.h
Go to the documentation of this file.
1 /*
2  * Distributed under the OpenDDS License.
3  * See: http://www.opendds.org/license.html
4  */
5 
6 #ifndef OPENDDS_DCPS_MULTICAST_MANAGER_H
7 #define OPENDDS_DCPS_MULTICAST_MANAGER_H
8 
9 #include "dcps_export.h"
10 
11 #include "NetworkConfigMonitor.h"
12 
13 #include <ace/SOCK_Dgram_Mcast.h>
14 
15 #ifndef ACE_LACKS_PRAGMA_ONCE
16 # pragma once
17 #endif /* ACE_LACKS_PRAGMA_ONCE */
18 
20 
21 namespace OpenDDS {
22 namespace DCPS {
23 
25 public:
26  /// Returns true if at least one group was joined.
28  InternalSampleInfoSequence& infos,
29  const OPENDDS_STRING& multicast_interface,
30  ACE_Reactor* reactor,
31  ACE_Event_Handler* event_handler,
32  const NetworkAddress& multicast_group_address,
33  ACE_SOCK_Dgram_Mcast& multicast_socket
34  #ifdef ACE_HAS_IPV6
35  , const NetworkAddress& ipv6_multicast_group_address,
36  ACE_SOCK_Dgram_Mcast& ipv6_multicast_socket
37  #endif
38  );
39 private:
40  size_t joined_interface_count() const;
41  bool join(const NetworkInterfaceAddress& nia,
42  ACE_Reactor* reactor,
43  ACE_Event_Handler* event_handler,
44  const NetworkAddress& multicast_group_address,
45  ACE_SOCK_Dgram_Mcast& multicast_socket
46 #ifdef ACE_HAS_IPV6
47  , const NetworkAddress& ipv6_multicast_group_address,
48  ACE_SOCK_Dgram_Mcast& ipv6_multicast_socket
49 #endif
50  );
51  void leave(const NetworkInterfaceAddress& nia,
52  const NetworkAddress& multicast_group_address,
53  ACE_SOCK_Dgram_Mcast& multicast_socket
54 #ifdef ACE_HAS_IPV6
55  , const NetworkAddress& ipv6_multicast_group_address,
56  ACE_SOCK_Dgram_Mcast& ipv6_multicast_socket
57 #endif
58 );
59 
60  OPENDDS_SET(OPENDDS_STRING) joined_interfaces_;
61 #ifdef ACE_HAS_IPV6
62  OPENDDS_SET(OPENDDS_STRING) ipv6_joined_interfaces_;
63 #endif
64 };
65 
66 } // namespace DCPS
67 } // namespace OpenDDS
68 
70 
71 #endif // OPENDDS_DCPS_MULTICAST_MANAGER_H
#define OpenDDS_Dcps_Export
Definition: dcps_export.h:24
#define OPENDDS_STRING
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
typedef OPENDDS_SET(NetworkAddress) AddrSet