3 // ===================================================================
5 * @file DIOP_Connection_Handler.h
7 * @author Michael Kircher
9 // ===================================================================
11 #ifndef TAO_DIOP_CONNECTION_HANDLER_H
12 #define TAO_DIOP_CONNECTION_HANDLER_H
14 #include /**/ "ace/pre.h"
16 #include "tao/orbconf.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #if defined (TAO_HAS_DIOP) && (TAO_HAS_DIOP != 0)
24 #include "tao/Strategies/strategies_export.h"
25 #include "tao/Wait_Strategy.h"
26 #include "tao/Connection_Handler.h"
27 #include "tao/Strategies/DIOP_Transport.h"
28 #include "ace/SOCK_Dgram.h"
29 #include "ace/Reactor.h"
30 #include "ace/Acceptor.h"
32 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
34 // ****************************************************************
37 * @class TAO_DIOP_Connection_Handler
39 * @brief Handles requests on a single connection.
41 * The Connection handler which is common for the Acceptor and
44 class TAO_Strategies_Export TAO_DIOP_Connection_Handler
45 : public TAO_DIOP_SVC_HANDLER
46 , public TAO_Connection_Handler
49 TAO_DIOP_Connection_Handler (ACE_Thread_Manager
* t
= 0);
52 TAO_DIOP_Connection_Handler (TAO_ORB_Core
*orb_core
);
55 ~TAO_DIOP_Connection_Handler ();
57 /// Called by the <Strategy_Acceptor> when the handler is completely
58 /// connected. Argument is unused.
59 virtual int open (void *);
61 // @@ Frank: Similar to open, but called on server
62 virtual int open_server ();
66 * Connection_Handler overloads
68 virtual int open_handler (void *);
71 /// Close called by the Acceptor or Connector when connection
72 /// establishment fails.
73 int close (u_long
= 0);
76 /** @name Event Handler overloads
78 virtual int resume_handler ();
79 virtual int close_connection ();
80 virtual int handle_input (ACE_HANDLE
);
81 virtual int handle_output (ACE_HANDLE
);
82 virtual int handle_close (ACE_HANDLE
, ACE_Reactor_Mask
);
83 virtual int handle_timeout (const ACE_Time_Value
¤t_time
,
87 /// Add ourselves to Cache.
88 int add_transport_to_cache ();
90 // @@ Frank: Not needed
92 /// Process the <listen_list>
93 int process_listen_point_list (DIOP::ListenPointList &listen_list);
96 // DIOP Additions - Begin
98 * @name The DIOP Additions
102 const ACE_INET_Addr
&addr ();
104 void addr (const ACE_INET_Addr
&addr
);
106 const ACE_INET_Addr
&local_addr ();
108 void local_addr (const ACE_INET_Addr
&addr
);
110 // DIOP Additions - End
112 /// Set Diff-Serv codepoint on outgoing packets.
113 int set_dscp_codepoint (CORBA::Boolean set_network_priority
);
114 int set_dscp_codepoint (CORBA::Long dscp_codepoint
);
119 * @name TAO_Connection Handler overloads
121 virtual int release_os_resources ();
122 virtual int handle_write_ready (const ACE_Time_Value
*timeout
);
125 /// Helper method used by the set_dscp_codepoint () methods
126 int set_tos (int tos
);
128 // DIOP Additions - Begin
130 * @name The DIOP Additions
134 /// This is always the remote address
137 /// This is always the local address for the connector
138 ACE_INET_Addr local_addr_
;
140 // DIOP Additions - End
143 /// Stores the type of service value.
147 TAO_END_VERSIONED_NAMESPACE_DECL
149 #endif /* TAO_HAS_DIOP && TAO_HAS_DIOP != 0 */
151 #include /**/ "ace/post.h"
153 #endif /* TAO_DIOP_CONNECTION_HANDLER_H */