00001
00002
00003
00004
00005
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
00036
00037
00038
00039 int reset(TcpConnection* connection, bool reset_mode = false);
00040
00041
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
00051
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 }
00063 }
00064
00065 #endif