00001 // -*- C++ -*- 00002 00003 // =================================================================== 00004 /** 00005 * @file SHMIOP_Connection_Handler.h 00006 * 00007 * $Id: SHMIOP_Connection_Handler.h 78931 2007-07-18 09:59:36Z johnnyw $ 00008 * 00009 * @author Nanbor Wang <nanbor@cs.wustl.edu> 00010 */ 00011 // =================================================================== 00012 00013 #ifndef TAO_SHMIOP_CONNECT_H 00014 #define TAO_SHMIOP_CONNECT_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include "tao/orbconf.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 #pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 #if defined (TAO_HAS_SHMIOP) && (TAO_HAS_SHMIOP != 0) 00025 00026 #include "ace/Reactor.h" 00027 #include "ace/Acceptor.h" 00028 #include "tao/Wait_Strategy.h" 00029 #include "tao/Connection_Handler.h" 00030 #include "tao/Strategies/SHMIOP_Transport.h" 00031 00032 // **************************************************************** 00033 00034 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00035 00036 /** 00037 * @class TAO_SHMIOP_Connection_Handler 00038 * 00039 * @brief Handles requests on a single connection. 00040 * 00041 * The Connection handler which is common for the Acceptor and 00042 * the Connector 00043 */ 00044 class TAO_Strategies_Export TAO_SHMIOP_Connection_Handler : 00045 public TAO_SHMIOP_SVC_HANDLER, 00046 public TAO_Connection_Handler 00047 { 00048 00049 public: 00050 /// Constructor. 00051 TAO_SHMIOP_Connection_Handler (ACE_Thread_Manager* t = 0); 00052 00053 /// Constructor. 00054 TAO_SHMIOP_Connection_Handler (TAO_ORB_Core *orb_core); 00055 00056 /// Destructor. 00057 ~TAO_SHMIOP_Connection_Handler (void); 00058 00059 /// Called by the <Strategy_Acceptor> when the handler is completely 00060 /// connected. Argument is unused. 00061 virtual int open (void *); 00062 00063 //@{ 00064 /** 00065 * Connection_Handler overloads 00066 */ 00067 virtual int open_handler (void *); 00068 //@} 00069 00070 /// Close called by the Acceptor or Connector when connection 00071 /// establishment fails. 00072 int close (u_long = 0); 00073 00074 //@{ 00075 /** @name Event Handler overloads 00076 */ 00077 virtual int resume_handler (void); 00078 virtual int close_connection (void); 00079 virtual int handle_input (ACE_HANDLE); 00080 virtual int handle_output (ACE_HANDLE); 00081 virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask); 00082 virtual int handle_timeout (const ACE_Time_Value ¤t_time, 00083 const void *act = 0); 00084 //@} 00085 00086 /// Add ourselves to Cache. 00087 int add_transport_to_cache (void); 00088 00089 protected: 00090 00091 //@{ 00092 /** 00093 * @name TAO_Connection Handler overloads 00094 */ 00095 virtual int release_os_resources (void); 00096 //@} 00097 00098 private: 00099 /// Flag that we will be passing to the event handler to indicate 00100 /// whether the handle will be resumed by the method or not. 00101 int resume_flag_; 00102 00103 }; 00104 00105 TAO_END_VERSIONED_NAMESPACE_DECL 00106 00107 #endif /* TAO_HAS_SHMIOP && TAO_HAS_SHMIOP != 0 */ 00108 00109 #include /**/ "ace/post.h" 00110 00111 #endif /* TAO_SHMIOP_CONNECT_H */