SCIOP_Connection_Handler.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 // SCIOP_Connection_Handler.h,v 1.13 2006/04/19 11:38:50 jwillemsen Exp
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 // Forward Decls
00046 class TAO_Pluggable_Messaging;
00047 
00048 // ****************************************************************
00049 
00050 /**
00051  * @class TAO_SCIOP_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 
00059 
00060 class TAO_Strategies_Export TAO_SCIOP_Connection_Handler
00061   : public TAO_SCIOP_SVC_HANDLER,
00062     public TAO_Connection_Handler
00063 {
00064 
00065 public:
00066 
00067   TAO_SCIOP_Connection_Handler (ACE_Thread_Manager* t = 0);
00068 
00069   /// Constructor.
00070   TAO_SCIOP_Connection_Handler (TAO_ORB_Core *orb_core,
00071                                 CORBA::Boolean flag);
00072 
00073   /// Destructor.
00074   ~TAO_SCIOP_Connection_Handler (void);
00075 
00076   //@{
00077   /**
00078    * Connection_Handler overloads
00079    */
00080   virtual int open_handler (void *);
00081   //@}
00082 
00083   /// Called by the <Strategy_Acceptor> when the handler is completely
00084   /// connected.  Argument is unused.
00085   virtual int open (void *);
00086 
00087   /// Close called by the Acceptor or Connector when connection
00088   /// establishment fails.
00089   int close (u_long = 0);
00090 
00091   //@{
00092   /** @name Event Handler overloads
00093    */
00094   virtual int resume_handler (void);
00095   virtual int close_connection (void);
00096   virtual int handle_input (ACE_HANDLE);
00097   virtual int handle_output (ACE_HANDLE);
00098   virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask);
00099   virtual int handle_timeout (const ACE_Time_Value &current_time,
00100                               const void *act = 0);
00101   //@}
00102 
00103   /// Add ourselves to Cache.
00104   int add_transport_to_cache (void);
00105 
00106   /// Process the <listen_list>
00107   int process_listen_point_list (IIOP::ListenPointList &listen_list);
00108 
00109   /// Set Diff-Serv codepoint on outgoing packets.
00110   int set_dscp_codepoint (CORBA::Boolean set_network_priority);
00111 
00112 protected:
00113 
00114   /// Constructor that could be used by the derived classes.
00115   /**
00116    * Sometimes new pluggbale protocols which have similarties with
00117    * IIOP may be tempted to this class for their use. Classical
00118    * example being that of IIOP_SSL_Connection_Handler. This
00119    * constructor just initializes its base class and sets all of its
00120    * contents to the default value, if any
00121    */
00122   TAO_SCIOP_Connection_Handler (TAO_ORB_Core *orb_core);
00123 
00124   //@{
00125   /**
00126    * @name TAO_Connection Handler overloads
00127    */
00128   //  void handle_close_i (void);
00129   virtual int release_os_resources (void);
00130   //@}
00131 
00132 private:
00133 
00134   /// Stores the type of service value.
00135   int dscp_codepoint_;
00136 };
00137 
00138 TAO_END_VERSIONED_NAMESPACE_DECL
00139 
00140 #endif /* TAO_HAS_SCIOP == 1 */
00141 
00142 #include /**/ "ace/post.h"
00143 
00144 #endif /* TAO_SCIOP_CONNECTION_HANDLER_H */

Generated on Thu Nov 9 13:39:29 2006 for TAO_Strategies by doxygen 1.3.6