OpenDDS  Snapshot(2023/04/28-20:55)
TcpReceiveStrategy.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_TCP_TCPRECEIVESTRATEGY_H
9 #define OPENDDS_DCPS_TRANSPORT_TCP_TCPRECEIVESTRATEGY_H
10 
11 #include "TcpConnection_rch.h"
12 #include "TcpDataLink_rch.h"
16 
18 
19 namespace OpenDDS {
20 namespace DCPS {
21 
22 class TcpConnection;
23 
25  : public TransportReceiveStrategy<>,
26  public virtual RcEventHandler
27 {
28 public:
29 
31  const ReactorTask_rch& task);
32 
33  virtual ~TcpReceiveStrategy();
34 
35  int reset(TcpConnection* old_connection, TcpConnection* new_connection);
36 
38 
40 
41 protected:
42 
43  virtual ssize_t receive_bytes(iovec iov[],
44  int n,
45  ACE_INET_Addr& remote_address,
46  ACE_HANDLE fd,
47  bool& stop);
48 
49  virtual void deliver_sample(ReceivedDataSample& sample,
50  const ACE_INET_Addr& remote_address);
51 
52  virtual int start_i();
53  virtual void stop_i();
54 
55  // Delegate to the connection object to re-establishment
56  // the connection.
57  virtual void relink(bool do_suspend = true);
58 
59 private:
60 
63 };
64 
65 } // namespace DCPS
66 } // namespace OpenDDS
67 
69 
70 #if defined (__ACE_INLINE__)
71 #include "TcpReceiveStrategy.inl"
72 #endif /* __ACE_INLINE__ */
73 
74 #endif /* OPENDDS_TCPRECEIVESTRATEGY_H */
virtual ssize_t receive_bytes(iovec iov[], int n, ACE_INET_Addr &remote_address, ACE_HANDLE fd, bool &stop)
Only our subclass knows how to do this.
int ssize_t
virtual void stop_i()
Let the subclass stop.
virtual int start_i()
Let the subclass start.
Holds a data sample received by the transport.
virtual void relink(bool do_suspend=true)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
TcpReceiveStrategy(TcpDataLink &link, const ReactorTask_rch &task)
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
virtual void deliver_sample(ReceivedDataSample &sample, const ACE_INET_Addr &remote_address)
Called when there is a ReceivedDataSample to be delivered.