OpenDDS  Snapshot(2023/04/28-20:55)
MulticastDataLink.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_MULTICASTDATALINK_H
9 #define OPENDDS_DCPS_TRANSPORT_MULTICAST_MULTICASTDATALINK_H
10 
11 #include "Multicast_Export.h"
12 #include "MulticastInst.h"
15 #include "MulticastTransport_rch.h"
16 #include "MulticastSession_rch.h"
18 #include "MulticastTypes.h"
19 
21 #include <dds/DCPS/PoolAllocator.h>
23 #include <dds/DCPS/ReactorTask.h>
25 
26 #include <ace/SOCK_Dgram_Mcast.h>
27 #include <ace/Synch_Traits.h>
28 
30 
31 namespace OpenDDS {
32 namespace DCPS {
33 
35  : public DataLink {
36 public:
38  const MulticastSessionFactory_rch& session_factory,
39  MulticastPeer local_peer,
40  const MulticastInst_rch& config,
41  const ReactorTask_rch& reactor_task,
42  bool is_active);
43  virtual ~MulticastDataLink();
44 
45  MulticastTransport_rch transport();
46 
47  MulticastPeer local_peer() const;
48 
49  MulticastSendStrategy* send_strategy();
50 
51  MulticastReceiveStrategy* receive_strategy();
52 
53  SingleSendBuffer* send_buffer();
54 
55  MulticastInst_rch config();
56 
57  ReactorTask_rch reactor_task();
58  ACE_Reactor* get_reactor();
59  ACE_Proactor* get_proactor();
60 
62 
63  bool join(const ACE_INET_Addr& group_address);
64 
65  MulticastSession_rch find_or_create_session(MulticastPeer remote_peer);
66  MulticastSession_rch find_session(MulticastPeer remote_peer);
67 
68  bool check_header(const TransportHeader& header);
69  bool check_header(const DataSampleHeader& header);
70  void sample_received(ReceivedDataSample& sample);
71 
72  bool reassemble(ReceivedDataSample& data, const TransportHeader& header);
73 
74  int make_reservation(const GUID_t& remote_publication_id,
75  const GUID_t& local_subscription_id,
76  const TransportReceiveListener_wrch& receive_listener,
77  bool reliable);
78  void release_reservations_i(const GUID_t& remote_id,
79  const GUID_t& local_id);
80 
81  void client_stop(const GUID_t& localId);
82 
83 private:
84 
86 
88 
90 
93 
95 
97 
99 
100  typedef OPENDDS_MAP(MulticastPeer, MulticastSession_rch) MulticastSessionMap;
101  MulticastSessionMap sessions_;
102 
103  virtual void stop_i();
104 
105  void syn_received_no_session(MulticastPeer source, const Message_Block_Ptr& data,
106  bool swap_bytes);
107 
108  void release_remote_i(const GUID_t& remote);
109  RepoIdSet readers_selected_, readers_withheld_;
110  bool ready_to_deliver(const ReceivedDataSample& data);
111 };
112 
113 } // namespace DCPS
114 } // namespace OpenDDS
115 
117 
118 #ifdef __ACE_INLINE__
119 # include "MulticastDataLink.inl"
120 #endif /* __ACE_INLINE__ */
121 
122 #endif /* DCPS_MULTICASTDATALINK_H */
ACE_INT64 MulticastPeer
GuidSet RepoIdSet
Definition: GuidUtils.h:113
#define OpenDDS_Multicast_Export
ACE_HANDLE socket(int protocol_family, int type, int proto)
MulticastReceiveStrategy_rch recv_strategy_
MulticastSendStrategy_rch send_strategy_
#define ACE_SYNCH_RECURSIVE_MUTEX
Christopher Diggins *renamed files *fixing compilation errors *adding Visual C project file *removed make Max Lybbert *removed references to missing and unused header
Definition: CHANGELOG.txt:8
Holds a data sample received by the transport.
Defines class that represents a transport packet header.
unique_ptr< SingleSendBuffer > send_buffer_
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
MulticastSessionFactory_rch session_factory_
ACE_SYNCH_RECURSIVE_MUTEX session_lock_
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
typedef OPENDDS_MAP(OPENDDS_STRING, OPENDDS_STRING) ValueMap
Helper types and functions for config file parsing.