00001 /* 00002 * 00003 * 00004 * Distributed under the OpenDDS License. 00005 * See: http://www.opendds.org/license.html 00006 */ 00007 00008 #ifndef OPENDDS_TCPCONNECTIONREPLACETASK_H 00009 #define OPENDDS_TCPCONNECTIONREPLACETASK_H 00010 00011 #include /**/ "ace/pre.h" 00012 00013 #include "TcpConnection_rch.h" 00014 #include "dds/DCPS/transport/framework/QueueTaskBase_T.h" 00015 00016 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00017 # pragma once 00018 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00019 00020 namespace OpenDDS { 00021 namespace DCPS { 00022 00023 class TcpTransport; 00024 00025 /** 00026 * @class TcpConnectionReplaceTask 00027 * 00028 * @brief Active Object managing a queue of connection info objects. 00029 * 00030 * This task is dedicated to check if the incoming connections are re-established 00031 * connection from the remote. This would resolve the deadlock problem between the 00032 * reactor thread (calling TcpTransport::passive_connection()) and the orb 00033 * thread (calling TcpTransport::make_passive_connection()). The reactor 00034 * thread will enqueue the new connection to this task and let this task dequeue 00035 * and check the connection. This task handles all connections associated with 00036 * a TransportImpl object. 00037 */ 00038 class TcpConnectionReplaceTask : public QueueTaskBase <TcpConnection_rch> { 00039 public: 00040 00041 /// Constructor. 00042 TcpConnectionReplaceTask(TcpTransport* trans); 00043 00044 /// Virtual Destructor. 00045 virtual ~TcpConnectionReplaceTask(); 00046 00047 /// Handle the request. 00048 virtual void execute(TcpConnection_rch& con); 00049 00050 private: 00051 00052 TcpTransport* trans_; 00053 }; 00054 00055 } // namespace DCPS 00056 } // namespace OpenDDS 00057 00058 #include /**/ "ace/post.h" 00059 00060 #endif /* OPENDDS_TCPCONNECTIONREPLACETASK_H */