TcpSendStrategy.h

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 #ifndef OPENDDS_TCPSENDSTRATEGY_H
00009 #define OPENDDS_TCPSENDSTRATEGY_H
00010 
00011 #include "TcpConnection_rch.h"
00012 #include "TcpDataLink_rch.h"
00013 #include "TcpInst_rch.h"
00014 #include "TcpConnection_rch.h"
00015 #include "dds/DCPS/transport/framework/TransportSendStrategy.h"
00016 #include "dds/DCPS/transport/framework/TransportReactorTask_rch.h"
00017 
00018 namespace OpenDDS {
00019 namespace DCPS {
00020 
00021 class TcpSynchResource;
00022 
00023 class TcpSendStrategy : public TransportSendStrategy {
00024 public:
00025 
00026   TcpSendStrategy(std::size_t id,
00027                   const TcpDataLink_rch& link,
00028                   const TcpInst_rch& config,
00029                   const TcpConnection_rch& connection,
00030                   TcpSynchResource* synch_resource,
00031                   const TransportReactorTask_rch& task,
00032                   Priority priority);
00033   virtual ~TcpSendStrategy();
00034 
00035   /// This is called by the datalink object to associate with the "new" connection object.
00036   /// The "old" connection object is unregistered with the reactor and the "new" connection
00037   /// object is registered for sending. The implementation of this method is borrowed from
00038   /// the ReceiveStrategy.
00039   int reset(TcpConnection* connection, bool reset_mode = false);
00040 
00041   /// Enable or disable output processing by the reactor according to mode.
00042   virtual void schedule_output();
00043 
00044 protected:
00045 
00046   virtual ssize_t send_bytes(const iovec iov[], int n, int& bp);
00047   virtual ACE_HANDLE get_handle();
00048   virtual ssize_t send_bytes_i(const iovec iov[], int n);
00049 
00050   /// Delegate to the connection object to re-establish
00051   /// the connection.
00052   virtual void relink(bool do_suspend = true);
00053 
00054   virtual void stop_i();
00055 
00056 private:
00057   TcpConnection_rch connection_;
00058   TcpDataLink_rch   link_;
00059   TransportReactorTask_rch reactor_task_;
00060 };
00061 
00062 } // namespace DCPS
00063 } // namespace OpenDDS
00064 
00065 #endif  /* OPENDDS_TCPSENDSTRATEGY_H */

Generated on Fri Feb 12 20:05:27 2016 for OpenDDS by  doxygen 1.4.7