Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Strategies / DIOP_Connection_Handler.h
blob20cbd7f2fa35fdedd1682d79cccae4b9030c44f8
1 // -*- C++ -*-
3 // ===================================================================
4 /**
5 * @file DIOP_Connection_Handler.h
7 * @author Michael Kircher
8 */
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)
19 #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 // ****************************************************************
36 /**
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
42 * the Connector
44 class TAO_Strategies_Export TAO_DIOP_Connection_Handler
45 : public TAO_DIOP_SVC_HANDLER
46 , public TAO_Connection_Handler
48 public:
49 TAO_DIOP_Connection_Handler (ACE_Thread_Manager* t = 0);
51 /// Constructor.
52 TAO_DIOP_Connection_Handler (TAO_ORB_Core *orb_core);
54 /// Destructor.
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 ();
64 //@{
65 /**
66 * Connection_Handler overloads
68 virtual int open_handler (void *);
69 //@}
71 /// Close called by the Acceptor or Connector when connection
72 /// establishment fails.
73 int close (u_long = 0);
75 //@{
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 &current_time,
84 const void *act = 0);
85 //@}
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
97 /**
98 * @name The DIOP Additions
101 //@{
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);
109 //@}
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);
116 protected:
117 //@{
119 * @name TAO_Connection Handler overloads
121 virtual int release_os_resources ();
122 virtual int handle_write_ready (const ACE_Time_Value *timeout);
123 //@}
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
133 //@{
134 /// This is always the remote address
135 ACE_INET_Addr addr_;
137 /// This is always the local address for the connector
138 ACE_INET_Addr local_addr_;
139 //@}
140 // DIOP Additions - End
142 private:
143 /// Stores the type of service value.
144 int dscp_codepoint_;
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 */