00001 // -*- C++ -*- 00002 00003 // $Id: SCIOP_Connection_Handler.h 78950 2007-07-19 11:53:18Z johnnyw $ 00004 // =================================================================== 00005 /** 00006 * @file SCIOP_Connection_Handler.h 00007 * 00008 * @author Jason Cohen, Lockheed Martin ATL <jcohen@atl.lmco.com> 00009 * @author Keith O'Hara, Lockheed Martin ATL 00010 */ 00011 // =================================================================== 00012 00013 #ifndef TAO_SCIOP_CONNECTION_HANDLER_H 00014 #define TAO_SCIOP_CONNECTION_HANDLER_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 TAO_HAS_SCIOP == 1 00025 00026 #include "tao/Strategies/strategies_export.h" 00027 #include "tao/Connection_Handler.h" 00028 #include "tao/IIOPC.h" 00029 #include "tao/TimeBaseC.h" 00030 00031 #include "ace/Reactor.h" 00032 #include "ace/Svc_Handler.h" 00033 #include "ace/SOCK_SEQPACK_Association.h" 00034 00035 #if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT 00036 template class TAO_Strategies_Export ACE_Svc_Handler<ACE_SOCK_SEQPACK_ASSOCIATION, ACE_NULL_SYNCH>; 00037 #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT */ 00038 00039 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00040 00041 // Service Handler for this transport 00042 typedef ACE_Svc_Handler<ACE_SOCK_SEQPACK_ASSOCIATION, ACE_NULL_SYNCH> 00043 TAO_SCIOP_SVC_HANDLER; 00044 00045 // **************************************************************** 00046 00047 /** 00048 * @class TAO_SCIOP_Connection_Handler 00049 * 00050 * @brief Handles requests on a single connection. 00051 * 00052 * The Connection handler which is common for the Acceptor and 00053 * the Connector 00054 */ 00055 00056 00057 class TAO_Strategies_Export TAO_SCIOP_Connection_Handler 00058 : public TAO_SCIOP_SVC_HANDLER, 00059 public TAO_Connection_Handler 00060 { 00061 00062 public: 00063 00064 TAO_SCIOP_Connection_Handler (ACE_Thread_Manager* t = 0); 00065 00066 /// Constructor. 00067 TAO_SCIOP_Connection_Handler (TAO_ORB_Core *orb_core); 00068 00069 /// Destructor. 00070 ~TAO_SCIOP_Connection_Handler (void); 00071 00072 //@{ 00073 /** 00074 * Connection_Handler overloads 00075 */ 00076 virtual int open_handler (void *); 00077 //@} 00078 00079 /// Called by the <Strategy_Acceptor> when the handler is completely 00080 /// connected. Argument is unused. 00081 virtual int open (void *); 00082 00083 /// Close called by the Acceptor or Connector when connection 00084 /// establishment fails. 00085 int close (u_long = 0); 00086 00087 //@{ 00088 /** @name Event Handler overloads 00089 */ 00090 virtual int resume_handler (void); 00091 virtual int close_connection (void); 00092 virtual int handle_input (ACE_HANDLE); 00093 virtual int handle_output (ACE_HANDLE); 00094 virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask); 00095 virtual int handle_timeout (const ACE_Time_Value ¤t_time, 00096 const void *act = 0); 00097 //@} 00098 00099 /// Add ourselves to Cache. 00100 int add_transport_to_cache (void); 00101 00102 /// Process the <listen_list> 00103 int process_listen_point_list (IIOP::ListenPointList &listen_list); 00104 00105 /// Set Diff-Serv codepoint on outgoing packets. 00106 int set_dscp_codepoint (CORBA::Boolean set_network_priority); 00107 int set_dscp_codepoint (CORBA::Long dscp); 00108 00109 protected: 00110 00111 /// Helper method needed by the set_dscp_codepoint () methods 00112 int set_tos (int tos); 00113 00114 //@{ 00115 /** 00116 * @name TAO_Connection Handler overloads 00117 */ 00118 // void handle_close_i (void); 00119 virtual int release_os_resources (void); 00120 //@} 00121 00122 private: 00123 00124 /// Stores the type of service value. 00125 int dscp_codepoint_; 00126 }; 00127 00128 TAO_END_VERSIONED_NAMESPACE_DECL 00129 00130 #endif /* TAO_HAS_SCIOP == 1 */ 00131 00132 #include /**/ "ace/post.h" 00133 00134 #endif /* TAO_SCIOP_CONNECTION_HANDLER_H */