IIOP_Connection_Handler.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 // ===================================================================
00004 /**
00005  *  @file   IIOP_Connection_Handler.h
00006  *
00007  *  $Id: IIOP_Connection_Handler.h 79686 2007-09-21 08:33:21Z johnnyw $
00008  *
00009  *  @author Originally by Chris Cleeland as IIOP_Connect.h
00010  *  @author Balachandran Natarajan <bala@cs.wustl.edu>
00011  */
00012 // ===================================================================
00013 
00014 #ifndef TAO_IIOP_CONNECTION_HANDLER_H
00015 #define TAO_IIOP_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 defined (TAO_HAS_IIOP) && (TAO_HAS_IIOP != 0)
00026 
00027 #include "tao/Connection_Handler.h"
00028 #include "tao/Basic_Types.h"
00029 
00030 #include "ace/SOCK_Stream.h"
00031 #include "ace/Svc_Handler.h"
00032 
00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00034 
00035 /// Service Handler for this transport
00036 typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
00037         TAO_IIOP_SVC_HANDLER;
00038 
00039 #if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT
00040 template class TAO_Export ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>;
00041 #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT */
00042 
00043 namespace IIOP
00044 {
00045   class ListenPointList;
00046 }
00047 
00048 // ****************************************************************
00049 
00050 /**
00051  * @class TAO_IIOP_Connection_Handler
00052  *
00053  * @brief  Handles requests on a single connection.
00054  *
00055  * The Connection handler which is common for the Acceptor and
00056  * the Connector
00057  */
00058 class TAO_Export TAO_IIOP_Connection_Handler : public TAO_IIOP_SVC_HANDLER,
00059                                                public TAO_Connection_Handler
00060 {
00061 
00062 public:
00063 
00064   TAO_IIOP_Connection_Handler (ACE_Thread_Manager * = 0);
00065 
00066   /// Constructor.
00067   TAO_IIOP_Connection_Handler (TAO_ORB_Core *orb_core);
00068 
00069   /// Destructor.
00070   ~TAO_IIOP_Connection_Handler (void);
00071 
00072   /// Called by the @c Strategy_Acceptor when the handler is completely
00073   /// connected.  Argument is unused.
00074   virtual int open (void *);
00075 
00076   /// Close called by the Acceptor or Connector when connection
00077   /// establishment fails.
00078   int close (u_long = 0);
00079 
00080   //@{
00081   /** @name Event Handler overloads
00082    */
00083   virtual int resume_handler (void);
00084   virtual int close_connection (void);
00085   virtual int handle_input (ACE_HANDLE);
00086   virtual int handle_output (ACE_HANDLE);
00087   virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask);
00088   virtual int handle_timeout (const ACE_Time_Value &current_time,
00089                               const void *act = 0);
00090   //@}
00091 
00092   /// Add ourselves to Cache.
00093   int add_transport_to_cache (void);
00094 
00095   /// Process the @a listen_list
00096   int process_listen_point_list (IIOP::ListenPointList &listen_list);
00097 
00098   /// Check if network priority needs to be enabled
00099   int enable_network_priority (void);
00100 
00101   /// Set Diff-Serv codepoint on outgoing packets.
00102   int set_dscp_codepoint (CORBA::Boolean set_network_priority);
00103   int set_dscp_codepoint (CORBA::Long dscp_codepoint);
00104 
00105   virtual int open_handler (void *);
00106 
00107   /// This is used during a canceled connection attempt. Force the
00108   /// SO_LINGER timeout to 0 so that when the peer is closed, it won't
00109   /// hang around.
00110   void abort (void);
00111 
00112 protected:
00113 
00114   //@{
00115   /**
00116    * @name TAO_Connection Handler overloads
00117    */
00118   virtual int release_os_resources (void);
00119   //@}
00120 
00121   // helper function used by the set_dscp_codepoint () methods to
00122   // set the TOS field in the IP packets.
00123   int set_tos (int tos);
00124 
00125 private:
00126 
00127   /// Stores the type of service value.
00128   int dscp_codepoint_;
00129 };
00130 
00131 TAO_END_VERSIONED_NAMESPACE_DECL
00132 
00133 #endif /* TAO_HAS_IIOP && TAO_HAS_IIOP != 0 */
00134 
00135 #include /**/ "ace/post.h"
00136 #endif /* TAO_IIOP_CONNECTION_HANDLER_H */

Generated on Tue Feb 2 17:37:52 2010 for TAO by  doxygen 1.4.7