Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tao / IIOP_Connection_Handler.h
blob84eec039289ae21d9ae1b75d9a19aeb4040fc415
1 // -*- C++ -*-
3 // ===================================================================
4 /**
5 * @file IIOP_Connection_Handler.h
7 * @author Originally by Chris Cleeland as IIOP_Connect.h
8 * @author Balachandran Natarajan <bala@cs.wustl.edu>
9 */
10 // ===================================================================
12 #ifndef TAO_IIOP_CONNECTION_HANDLER_H
13 #define TAO_IIOP_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 defined (TAO_HAS_IIOP) && (TAO_HAS_IIOP != 0)
25 #include "tao/Connection_Handler.h"
26 #include "tao/Basic_Types.h"
28 #include "ace/SOCK_Stream.h"
29 #include "ace/Svc_Handler.h"
31 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
33 /// Service Handler for this transport
34 typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>
35 TAO_IIOP_SVC_HANDLER;
37 #if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT
38 template class TAO_Export ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>;
39 #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT */
41 namespace IIOP
43 class ListenPointList;
46 // ****************************************************************
48 /**
49 * @class TAO_IIOP_Connection_Handler
51 * @brief Handles requests on a single connection.
53 * The Connection handler which is common for the Acceptor and
54 * the Connector
56 class TAO_Export TAO_IIOP_Connection_Handler : public TAO_IIOP_SVC_HANDLER,
57 public TAO_Connection_Handler
59 public:
60 #ifdef TAO_LOG_CH_REF_COUNTS
61 Reference_Count add_reference ();
62 Reference_Count remove_reference ();
63 #endif
65 TAO_IIOP_Connection_Handler (ACE_Thread_Manager * = 0);
67 /// Constructor.
68 TAO_IIOP_Connection_Handler (TAO_ORB_Core *orb_core);
70 /// Destructor.
71 ~TAO_IIOP_Connection_Handler ();
73 /// Called by the @c Strategy_Acceptor when the handler is completely
74 /// connected. Argument is unused.
75 virtual int open (void *);
77 /// Close called by the Acceptor or Connector when connection
78 /// establishment fails.
79 int close (u_long = 0);
81 //@{
82 /** @name Event Handler overloads
84 virtual int resume_handler ();
85 virtual int close_connection ();
86 virtual int handle_input (ACE_HANDLE);
87 virtual int handle_output (ACE_HANDLE);
88 virtual int handle_close (ACE_HANDLE, ACE_Reactor_Mask);
89 virtual int handle_timeout (const ACE_Time_Value &current_time,
90 const void *act = 0);
91 //@}
93 /// Add ourselves to Cache.
94 int add_transport_to_cache ();
96 /// Process the @a listen_list
97 int process_listen_point_list (IIOP::ListenPointList &listen_list);
99 /// Check if network priority needs to be enabled
100 int enable_network_priority ();
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_codepoint);
106 virtual int open_handler (void *);
108 /// This is used during a canceled connection attempt. Force the
109 /// SO_LINGER timeout to 0 so that when the peer is closed, it won't
110 /// hang around.
111 void abort ();
113 protected:
114 //@{
116 * @name TAO_Connection Handler overloads
118 virtual int release_os_resources ();
119 //@}
121 virtual int handle_write_ready (const ACE_Time_Value *timeout);
123 /// helper function used by the set_dscp_codepoint () methods to
124 /// set the TOS field in the IP packets.
125 int set_tos (int tos);
127 private:
128 /// Stores the type of service value.
129 int dscp_codepoint_;
132 TAO_END_VERSIONED_NAMESPACE_DECL
134 #endif /* TAO_HAS_IIOP && TAO_HAS_IIOP != 0 */
136 #include /**/ "ace/post.h"
137 #endif /* TAO_IIOP_CONNECTION_HANDLER_H */