Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Strategies / SCIOP_Connection_Handler.h
blobf1dd65710cd92af4076d34e418e2532f7bc86e12
1 // -*- C++ -*-
3 // ===================================================================
4 /**
5 * @file SCIOP_Connection_Handler.h
7 * @author Jason Cohen, Lockheed Martin ATL <jcohen@atl.lmco.com>
8 * @author Keith O'Hara, Lockheed Martin ATL
9 */
10 // ===================================================================
12 #ifndef TAO_SCIOP_CONNECTION_HANDLER_H
13 #define TAO_SCIOP_CONNECTION_HANDLER_H
15 #include /**/ "ace/pre.h"
17 #include "tao/orbconf.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #if TAO_HAS_SCIOP == 1
25 #include "tao/Strategies/strategies_export.h"
26 #include "tao/Connection_Handler.h"
27 #include "tao/IIOPC.h"
28 #include "tao/TimeBaseC.h"
30 #include "ace/Reactor.h"
31 #include "ace/Svc_Handler.h"
32 #include "ace/SOCK_SEQPACK_Association.h"
34 #if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT
35 template class TAO_Strategies_Export ACE_Svc_Handler<ACE_SOCK_SEQPACK_ASSOCIATION, ACE_NULL_SYNCH>;
36 #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT */
38 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
40 // Service Handler for this transport
41 typedef ACE_Svc_Handler<ACE_SOCK_SEQPACK_ASSOCIATION, ACE_NULL_SYNCH>
42 TAO_SCIOP_SVC_HANDLER;
44 // ****************************************************************
46 /**
47 * @class TAO_SCIOP_Connection_Handler
49 * @brief Handles requests on a single connection.
51 * The Connection handler which is common for the Acceptor and
52 * the Connector
56 class TAO_Strategies_Export TAO_SCIOP_Connection_Handler
57 : public TAO_SCIOP_SVC_HANDLER,
58 public TAO_Connection_Handler
60 public:
61 TAO_SCIOP_Connection_Handler (ACE_Thread_Manager* t = 0);
63 /// Constructor.
64 TAO_SCIOP_Connection_Handler (TAO_ORB_Core *orb_core);
66 /// Destructor.
67 ~TAO_SCIOP_Connection_Handler ();
69 //@{
70 /**
71 * Connection_Handler overloads
73 virtual int open_handler (void *);
74 //@}
76 /// Called by the <Strategy_Acceptor> when the handler is completely
77 /// connected. Argument is unused.
78 virtual int open (void *);
80 /// Close called by the Acceptor or Connector when connection
81 /// establishment fails.
82 int close (u_long = 0);
84 //@{
85 /** @name Event Handler overloads
87 virtual int resume_handler ();
88 virtual int close_connection ();
89 virtual int handle_input (ACE_HANDLE);
90 virtual int handle_output (ACE_HANDLE);
91 virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask);
92 virtual int handle_timeout (const ACE_Time_Value &current_time,
93 const void *act = 0);
94 //@}
96 /// Add ourselves to Cache.
97 int add_transport_to_cache ();
99 /// Process the <listen_list>
100 int process_listen_point_list (IIOP::ListenPointList &listen_list);
102 /// Set Diff-Serv codepoint on outgoing packets.
103 int set_dscp_codepoint (CORBA::Boolean set_network_priority);
104 int set_dscp_codepoint (CORBA::Long dscp);
106 protected:
107 /// Helper method needed by the set_dscp_codepoint () methods
108 int set_tos (int tos);
110 //@{
112 * @name TAO_Connection Handler overloads
114 // void handle_close_i ();
115 virtual int release_os_resources ();
116 virtual int handle_write_ready (const ACE_Time_Value *timeout);
117 //@}
119 private:
120 /// Stores the type of service value.
121 int dscp_codepoint_;
124 TAO_END_VERSIONED_NAMESPACE_DECL
126 #endif /* TAO_HAS_SCIOP == 1 */
128 #include /**/ "ace/post.h"
130 #endif /* TAO_SCIOP_CONNECTION_HANDLER_H */