OpenDDS  Snapshot(2023/04/28-20:55)
TcpSendStrategy.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_TCPSENDSTRATEGY_H
9 #define OPENDDS_DCPS_TRANSPORT_TCP_TCPSENDSTRATEGY_H
10 
11 #include "TcpConnection_rch.h"
12 #include "TcpDataLink_rch.h"
13 #include "TcpInst_rch.h"
14 #include "TcpConnection_rch.h"
17 
19 
20 namespace OpenDDS {
21 namespace DCPS {
22 
23 class TcpSynchResource;
24 
26 public:
27 
28  TcpSendStrategy(std::size_t id,
29  TcpDataLink& link,
30  TcpSynchResource* synch_resource,
31  const ReactorTask_rch& task,
32  Priority priority);
33  virtual ~TcpSendStrategy();
34 
35  /// This is called by the datalink object to associate with the "new" connection object.
36  /// The "old" connection object is unregistered with the reactor and the "new" connection
37  /// object is registered for sending. The implementation of this method is borrowed from
38  /// the ReceiveStrategy.
39  int reset(bool reset_mode = false);
40 
41  /// Enable or disable output processing by the reactor according to mode.
42  virtual void schedule_output();
43  virtual void terminate_send_if_suspended();
44 
45 protected:
46 
47  virtual ssize_t send_bytes(const iovec iov[], int n, int& bp);
48  virtual ACE_HANDLE get_handle();
49  virtual ssize_t send_bytes_i(const iovec iov[], int n);
50 
51  /// Delegate to the connection object to re-establish
52  /// the connection.
53  virtual void relink(bool do_suspend = true);
54 
55  virtual void stop_i();
56  virtual void add_delayed_notification(TransportQueueElement* element);
57 private:
60 };
61 
62 } // namespace DCPS
63 } // namespace OpenDDS
64 
66 
67 #endif /* OPENDDS_TCPSENDSTRATEGY_H */
int reset(bool reset_mode=false)
int ssize_t
virtual ACE_HANDLE get_handle()
virtual ssize_t send_bytes(const iovec iov[], int n, int &bp)
virtual ssize_t send_bytes_i(const iovec iov[], int n)
virtual void schedule_output()
Enable or disable output processing by the reactor according to mode.
virtual void add_delayed_notification(TransportQueueElement *element)
TcpSendStrategy(std::size_t id, TcpDataLink &link, TcpSynchResource *synch_resource, const ReactorTask_rch &task, Priority priority)
ACE_CDR::Long Priority
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
virtual void stop_i()
Let the subclass stop.
virtual void relink(bool do_suspend=true)
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
Base wrapper class around a data/control sample to be sent.