00001 // -*- C++ -*- 00002 00003 // =================================================================== 00004 /** 00005 * @file UIOP_Connection_Handler.h 00006 * 00007 * UIOP_Connection_Handler.h,v 1.24 2006/04/19 11:38:50 jwillemsen Exp 00008 * 00009 * @author Originally by Ossama Othman <ossama@ece.uci.edu> as 00010 * UIOP_Connect.h 00011 * @author modified by Balachandran Natarajan <bala@cs.wustl.edu> 00012 */ 00013 // =================================================================== 00014 #ifndef TAO_UIOP_CONNECTION_HANDLER_H 00015 #define TAO_UIOP_CONNECTION_HANDLER_H 00016 00017 #include /**/ "ace/pre.h" 00018 00019 #include "tao/orbconf.h" 00020 00021 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00022 #pragma once 00023 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00024 00025 #if TAO_HAS_UIOP == 1 00026 00027 #include "tao/Strategies/UIOP_Transport.h" 00028 #include "tao/Connection_Handler.h" 00029 #include "tao/Wait_Strategy.h" 00030 #include "ace/Acceptor.h" 00031 #include "ace/Reactor.h" 00032 00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00034 00035 // Forward Decls 00036 class TAO_Pluggable_Messaging; 00037 00038 // **************************************************************** 00039 00040 /** 00041 * @class TAO_UIOP_Connection_Handler 00042 * 00043 * @brief Handles requests on a single connection. 00044 * 00045 * The Connection handler which is common for the Acceptor and 00046 * the Connector 00047 */ 00048 class TAO_Strategies_Export TAO_UIOP_Connection_Handler : public TAO_UIOP_SVC_HANDLER, 00049 public TAO_Connection_Handler 00050 { 00051 00052 public: 00053 00054 TAO_UIOP_Connection_Handler (ACE_Thread_Manager* t = 0); 00055 00056 /// Constructor. 00057 TAO_UIOP_Connection_Handler (TAO_ORB_Core *orb_core, 00058 CORBA::Boolean flag); 00059 00060 /// Destructor. 00061 ~TAO_UIOP_Connection_Handler (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 open (void *); 00078 virtual int resume_handler (void); 00079 virtual int close_connection (void); 00080 virtual int handle_input (ACE_HANDLE); 00081 virtual int handle_output (ACE_HANDLE); 00082 virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask); 00083 virtual int handle_timeout (const ACE_Time_Value ¤t_time, 00084 const void *act = 0); 00085 //@} 00086 00087 /// Add ourselves to Cache. 00088 int add_transport_to_cache (void); 00089 00090 protected: 00091 00092 //@{ 00093 /** 00094 * @name TAO_Connection Handler overloads 00095 */ 00096 virtual int release_os_resources (void); 00097 //@} 00098 }; 00099 00100 TAO_END_VERSIONED_NAMESPACE_DECL 00101 00102 #endif /* TAO_HAS_UIOP == 1 */ 00103 00104 #include /**/ "ace/post.h" 00105 00106 #endif /* TAO_UIOP_CONNECT_H */