3 // ===================================================================
5 * @file IIOP_Connection_Handler.h
7 * @author Originally by Chris Cleeland as IIOP_Connect.h
8 * @author Balachandran Natarajan <bala@cs.wustl.edu>
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)
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
>
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 */
43 class ListenPointList
;
46 // ****************************************************************
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
56 class TAO_Export TAO_IIOP_Connection_Handler
: public TAO_IIOP_SVC_HANDLER
,
57 public TAO_Connection_Handler
60 #ifdef TAO_LOG_CH_REF_COUNTS
61 Reference_Count
add_reference ();
62 Reference_Count
remove_reference ();
65 TAO_IIOP_Connection_Handler (ACE_Thread_Manager
* = 0);
68 TAO_IIOP_Connection_Handler (TAO_ORB_Core
*orb_core
);
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);
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
¤t_time
,
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
116 * @name TAO_Connection Handler overloads
118 virtual int release_os_resources ();
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
);
128 /// Stores the type of service value.
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 */