TcpReconnectTask.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_TCPRECONNECTTASK_H
00009 #define OPENDDS_TCPRECONNECTTASK_H
00010 
00011 #include /**/ "ace/pre.h"
00012 
00013 #include "dds/DCPS/transport/framework/QueueTaskBase_T.h"
00014 
00015 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00016 # pragma once
00017 #endif /* ACE_LACKS_PRAGMA_ONCE */
00018 
00019 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00020 
00021 namespace OpenDDS {
00022 namespace DCPS {
00023 
00024 class TcpConnection;
00025 
00026 enum ReconnectOpType {
00027   DO_RECONNECT
00028 };
00029 
00030 /**
00031  * @class TcpReconnectTask
00032  *
00033  * @brief Active Object managing a queue of reconnecting request.
00034  *
00035  *  This task handles request to reconnect to the remotes to avoid the
00036  *  the caller threads (thread to send or reactor thread) block on reconnecting.
00037  *  This reconnect task has lifetime as TcpConnection object. One reconnect
00038  *  task just dedicates to a single connection.
00039  */
00040 class TcpReconnectTask : public QueueTaskBase <ReconnectOpType> {
00041 public:
00042   TcpReconnectTask(TcpConnection* con);
00043 
00044   virtual ~TcpReconnectTask();
00045 
00046   /// Handle reconnect requests.
00047   virtual void execute(ReconnectOpType& op);
00048 
00049 private:
00050 
00051   /// The connection that needs be re-established.
00052   TcpConnection* connection_;
00053 };
00054 
00055 } // namespace DCPS
00056 } // namespace OpenDDS
00057 
00058 OPENDDS_END_VERSIONED_NAMESPACE_DECL
00059 
00060 #include /**/ "ace/post.h"
00061 
00062 #endif /* OPENDDS_TCPRECONNECTTASK_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1