OpenDDS  Snapshot(2023/04/28-20:55)
UdpReceiveStrategy.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_UDP_UDPRECEIVESTRATEGY_H
9 #define OPENDDS_DCPS_TRANSPORT_UDP_UDPRECEIVESTRATEGY_H
10 
11 #include "Udp_Export.h"
12 
13 #include "ace/INET_Addr.h"
14 
17 
19 
20 namespace OpenDDS {
21 namespace DCPS {
22 
23 class UdpDataLink;
24 
26  : public TransportReceiveStrategy<>,
27  public virtual RcEventHandler
28 {
29 public:
30  explicit UdpReceiveStrategy(UdpDataLink* link);
31 
32  virtual ACE_HANDLE get_handle() const;
33  virtual int handle_input(ACE_HANDLE fd);
34 
35 protected:
36  virtual ssize_t receive_bytes(iovec iov[],
37  int n,
38  ACE_INET_Addr& remote_address,
39  ACE_HANDLE fd,
40  bool& stop);
41 
42  virtual void deliver_sample(ReceivedDataSample& sample,
43  const ACE_INET_Addr& remote_address);
44 
45  virtual int start_i();
46  virtual void stop_i();
47 
48  virtual bool check_header(const TransportHeader& header);
49 
50  virtual bool check_header(const DataSampleHeader& header)
51  {
53  }
54 
55 private:
56 
57  virtual bool reassemble(ReceivedDataSample& data);
58 
61  ACE_INET_Addr remote_address_; // of the current datagram
62 
63  typedef std::pair<TransportReassembly_rch, SequenceNumber> ReassemblyInfo;
64  typedef OPENDDS_MAP(ACE_INET_Addr, ReassemblyInfo) ReassemblyMap;
65  ReassemblyMap reassembly_;
66 };
67 
68 } // namespace DCPS
69 } // namespace OpenDDS
70 
72 
73 #endif /* DCPS_UDPRECEIVESTRATEGY_H */
int ssize_t
std::pair< TransportReassembly_rch, SequenceNumber > ReassemblyInfo
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.
ACE_HANDLE get_handle(void)
Sequence number abstraction. Only allows positive 64 bit values.
virtual bool check_header(const DataSampleHeader &header)
Check the data sample header for suitability.
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
virtual bool check_header(const TH &header)
Check the transport header for suitability.
#define OpenDDS_Udp_Export
Definition: Udp_Export.h:24
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.