summaryrefslogtreecommitdiff
path: root/TAO
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2000-10-18 22:10:40 +0000
committerbala <balanatarajan@users.noreply.github.com>2000-10-18 22:10:40 +0000
commitb1b10a96420d3e6ea154939dc9f0f752dccc6367 (patch)
tree02f84d9f1fb0a9efd98b617da04e47a68f6827ab /TAO
parent16263503cc4499afe2889119bcb509ccb78f78dc (diff)
downloadATCD-b1b10a96420d3e6ea154939dc9f0f752dccc6367.tar.gz
*** empty log message ***
Diffstat (limited to 'TAO')
-rw-r--r--TAO/tao/Cache_Entries.h7
-rw-r--r--TAO/tao/Cache_Entries.i10
-rw-r--r--TAO/tao/Connection_Cache_Manager.cpp113
-rw-r--r--TAO/tao/Connection_Cache_Manager.h137
-rw-r--r--TAO/tao/Connection_Cache_Manager.i10
-rw-r--r--TAO/tao/Connection_Handler.cpp2
-rw-r--r--TAO/tao/IIOP_Connect.h1
-rw-r--r--TAO/tao/Makefile1
-rw-r--r--TAO/tao/UIOP_Connect.cpp184
-rw-r--r--TAO/tao/UIOP_Connect.h33
10 files changed, 323 insertions, 175 deletions
diff --git a/TAO/tao/Cache_Entries.h b/TAO/tao/Cache_Entries.h
index 1db3efac6c4..7d9f363850b 100644
--- a/TAO/tao/Cache_Entries.h
+++ b/TAO/tao/Cache_Entries.h
@@ -50,7 +50,8 @@ public:
TAO_Cache_IntId (void);
// Constructor.
- TAO_Cache_IntId (ACE_HANDLE &handle);
+ TAO_Cache_IntId (ACE_HANDLE &handle,
+ TAO_Connection_Handler *handler);
// Constructor.
TAO_Cache_IntId (const TAO_IntId & rhs);
@@ -59,11 +60,13 @@ public:
~TAO_Cache_IntId (void);
// Destructor.
-
private:
ACE_HANDLE handle_;
// <handle> in the cache
+ TAO_Connection_Handler *handler_;
+ // The connection handler that needs to be cached.
+
// @@ Need to add properties that need to be associated with this
// connection
};
diff --git a/TAO/tao/Cache_Entries.i b/TAO/tao/Cache_Entries.i
index 6d6a448a0f2..877d82b8233 100644
--- a/TAO/tao/Cache_Entries.i
+++ b/TAO/tao/Cache_Entries.i
@@ -3,14 +3,16 @@
ACE_INLINE
TAO_Cache_IntId::TAO_Cache_IntId (void)
- :handle_ ()
+ :handle_ (),
+ handler_ (0)
{
-
}
ACE_INLINE
-TAO_Cache_IntId::TAO_Cache_IntId (ACE_HANDLE &handle)
- :handle_ (handle)
+TAO_Cache_IntId::TAO_Cache_IntId (ACE_HANDLE &handle,
+ TAO_Connection_Handler *handler)
+ :handle_ (handle),
+ handler_ (handler)
{
}
diff --git a/TAO/tao/Connection_Cache_Manager.cpp b/TAO/tao/Connection_Cache_Manager.cpp
new file mode 100644
index 00000000000..41d0914d891
--- /dev/null
+++ b/TAO/tao/Connection_Cache_Manager.cpp
@@ -0,0 +1,113 @@
+#include "tao/Connection_Cache_Manager.h"
+
+
+
+#if !defined (__ACE_INLINE__)
+# include "tao/Connection_Cache_Manager.i"
+#endif /* __ACE_INLINE__ */
+
+
+ACE_RCSID(tao, Connection_Cache_Hash_Manager, "$Id$")
+
+
+TAO_Connection_Cache_Manager::~TAO_Connection_Cache_Hash_Manager (void)
+{
+ // Close the HASH MAP and release resources
+ HASH_MAP.close ();
+}
+
+
+int
+TAO_Connection_Cache_Manager::bind (const TAO_Cache_ExtId &ext_id,
+ const TAO_Cache_IntId &int_id)
+{
+ return HASH_MAP.bind (ext_id,
+ int_id);
+}
+
+
+int
+TAO_Connection_Cache_Manager::find (const TAO_Cache_ExtId &key,
+ TAO_Cache_IntId &value)
+{
+ return HASH_MAP.find (key,
+ value);
+}
+
+int
+TAO_Connection_Cache_Manager::rebind (const TAO_Cache_ExtId &key,
+ const TAO_Cache_IntId &value)
+{
+ return HASH_MAP.rebind (key,
+ value);
+}
+
+int
+TAO_Connection_Cache_Manager::trybind (const TAO_Cache_ExtId &key,
+ TAO_Cache_IntId &value)
+{
+ return HASH_MAP.trybind (key, value);
+}
+
+int
+TAO_Connection_Cache_Manager::unbind (const TAO_Cache_ExtId &key)
+{
+ return HASH_MAP.unbind (key);
+}
+
+int
+TAO_Connection_Cache_Manager::unbind (const TAO_Cache_ExtId &key,
+ TAO_Cache_IntId &value)
+{
+ return HASH_MAP.unbind (key,
+ value);
+}
+
+
+int
+TAO_Connection_Cache_Manager::purge (void)
+{
+}
+
+size_t
+TAO_Connection_Cache_Manager::current_size (void) const
+{
+ return HASH_MAP.current_size ();
+}
+
+size_t
+TAO_Connection_Cache_Manager::total_size (void) const
+{
+ return HASH_MAP.total_size ();
+}
+
+
+#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
+
+ // Instantiations for the Hash Map
+template class ACE_Equal_To<TAO_Cache_ExtId>;
+template class ACE_Hash<TAO_Cache_ExtId>;
+template class ACE_Hash_Map_Entry<TAO_Cache_ExtId, TAO_Cache_IntId>;
+template class ACE_Hash_Map_Manager<TAO_Cache_ExtId, TAO_Cache_IntId, ACE_Null_Mutex>;
+template class ACE_Hash_Map_Iterator<TAO_Cache_ExtId, TAO_Cache_IntId, ACE_Null_Mutex>;
+template class ACE_Hash_Map_Reverse_Iterator<TAO_Cache_ExtId, TAO_Cache_IntId, ACE_Null_Mutex>;
+template class ACE_Hash_Map_Manager_Ex<TAO_Cache_ExtId, TAO_Cache_IntId, ACE_Hash<TAO_Cache_ExtId>, ACE_Equal_To<TAO_Cache_ExtId>, ACE_Null_Mutex>;
+template class ACE_Hash_Map_Iterator_Base_Ex<TAO_Cache_ExtId, TAO_Cache_IntId, ACE_Hash<TAO_Cache_ExtId>, ACE_Equal_To<TAO_Cache_ExtId>, ACE_Null_Mutex>;
+template class ACE_Hash_Map_Iterator_Ex<TAO_Cache_ExtId, TAO_Cache_IntId, ACE_Hash<TAO_Cache_ExtId>, ACE_Equal_To<TAO_Cache_ExtId>, ACE_Null_Mutex>;
+template class ACE_Hash_Map_Reverse_Iterator_Ex<TAO_Cache_ExtId, TAO_Cache_IntId, ACE_Hash<TAO_Cache_ExtId>, ACE_Equal_To<TAO_Cache_ExtId>, ACE_Null_Mutex>;
+
+#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
+
+ // Instantiations for the Hash Map
+#pragma instantiate ACE_Equal_To<TAO_Cache_ExtId>
+#pragma instantiate ACE_Hash<TAO_Cache_ExtId>
+#pragma instantiate ACE_Hash_Map_Entry<TAO_Cache_ExtId, TAO_Cache_IntId>
+#pragma instantiate ACE_Hash_Map_Manager<TAO_Cache_ExtId, TAO_Cache_IntId, ACE_Null_Mutex>
+#pragma instantiate ACE_Hash_Map_Iterator<TAO_Cache_ExtId, TAO_Cache_IntId, ACE_Null_Mutex>
+#pragma instantiate ACE_Hash_Map_Reverse_Iterator<TAO_Cache_ExtId, TAO_Cache_IntId, ACE_Null_Mutex>
+#pragma instantiate ACE_Hash_Map_Manager_Ex<TAO_Cache_ExtId, TAO_Cache_IntId, ACE_Hash<TAO_Cache_ExtId>, ACE_Equal_To<TAO_Cache_ExtId>, ACE_Null_Mutex>
+#pragma instantiate ACE_Hash_Map_Iterator_Base_Ex<TAO_Cache_ExtId, TAO_Cache_IntId, ACE_Hash<TAO_Cache_ExtId>, ACE_Equal_To<TAO_Cache_ExtId>, ACE_Null_Mutex>
+#pragma instantiate ACE_Hash_Map_Iterator_Ex<TAO_Cache_ExtId, TAO_Cache_IntId, ACE_Hash<TAO_Cache_ExtId>, ACE_Equal_To<TAO_Cache_ExtId>, ACE_Null_Mutex>
+#pragma instantiate ACE_Hash_Map_Reverse_Iterator_Ex<TAO_Cache_ExtId, TAO_Cache_IntId, ACE_Hash<TAO_Cache_ExtId>, ACE_Equal_To<TAO_Cache_ExtId>, ACE_Null_Mutex>
+
+#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/TAO/tao/Connection_Cache_Manager.h b/TAO/tao/Connection_Cache_Manager.h
new file mode 100644
index 00000000000..d7eaf7e32c6
--- /dev/null
+++ b/TAO/tao/Connection_Cache_Manager.h
@@ -0,0 +1,137 @@
+/* -*- C++ -*- */
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO
+//
+// = FILENAME
+// Connection_Cache_Manager.h
+//
+// = AUTHOR
+// Bala Natarajan <bala@cs.wustl.edu>
+//
+// ============================================================================
+
+#ifndef TAO_CONNECTION_CACHE_MANAGER_H
+#define TAO_CONNECTION_CACHE_MANAGER_H
+#include "ace/pre.h"
+
+#include "tao/Hash_Map_Manager_T.h"
+
+
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+#define ACE_LACKS_PRAGMA_ONCE
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_Cache_ExtId;
+class TAO_Cache_IntId;
+
+class TAO_Export TAO_Connection_Cache_Manager
+{
+ // = TITLE
+
+
+ // = DESCRIPTION
+
+public:
+
+ // Some useful typedef's
+ typedef ACE_Hash_Map_Manager <TAO_Cache_ExtId,
+ TAO_Cache_IntId,
+ ACE_Null_Mutex>
+ HASH_MAP;
+
+ typedef ACE_Hash_Map_Iterator <TAO_Cache_ExtId,
+ TAO_Cache_IntId,
+ ACE_Null_Mutex>
+ HASH_MAP_ITER;
+
+ typedef ACE_Hash_Map_Reverse_Iterator <TAO_Cache_ExtId,
+ TAO_Cache_IntId,
+ ACE_Null_Mutex>
+ HASH_MAP_REV_ITER;
+
+ // == Public methods
+
+ TAO_Connection_Cache_Manager (void);
+ // Constructor
+
+ TAO_Connection_Cache_Manager (
+ ACE_Caching_Strategy<ATTRBIBUTES, CACHING_UTILITY> *strat);
+ // Constructor
+
+ virtual ~TAO_Connection_Cache_Manager (void);
+ // Destructor
+
+ int open (size_t size = ACE_DEFAULT_MAP_SIZE,
+ ACE_Allocator *alloc = 0);
+ // Initialize a <HASH_MAP> with <size> elements.
+
+ int bind (const TAO_Cache_ExtId &ext_id,
+ const TAO_Cache_IntId &int_id);
+ // Associate <ext_id> with <int_id>. If <ext_id> is already in the
+ // map then the <Map_Entry> is not changed. Returns 0 if a new
+ // entry is bound successfully, returns 1 if an attempt is made to
+ // bind an existing entry, and returns -1 if failures occur.
+
+ int find (const TAO_Cache_ExtId &key,
+ TAO_Cache_IntId &value);
+ // Lookup entry<key,value> in the cache. If it is not found, returns -1.
+ // If the <key> is located in the MAP object, the CACHING_STRATEGY is
+ // notified of it via notify_find (int result, ATTRIBUTES &attribute).
+ // If notify_find also returns 0 (success), then this function returns
+ // 0 (success) and sets the cached value in <value>.
+
+ int rebind (const TAO_Cache_ExtId &key,
+ const TAO_Cache_IntId &value);
+ // Reassociate the <key> with <value>. If the <key> already exists
+ // in the cache then returns 1, on a new bind returns 0 and returns
+ // -1 in case of any failures.
+
+ int trybind (const TAO_Cache_ExtId &key,
+ TAO_Cache_IntId &value);
+ // Associate <key> with <value> if and only if <key> is not in the
+ // cache. If <key> is already in the cache, then the <value>
+ // parameter is overwritten with the existing value in the
+ // cache. Returns 0 if a new <key>/<value> association is created.
+ // Returns 1 if an attempt is made to bind an existing entry. This
+ // function fails for maps that do not allow user specified keys.
+
+ int unbind (const TAO_Cache_ExtId &key);
+ // Remove <key> from the cache.
+
+ int unbind (const TAO_Cache_ExtId &key,
+ TAO_Cache_IntId &value);
+ // Remove <key> from the cache, and return the <value> associated with
+ // <key>.
+
+ int purge (void);
+ // Remove entries from the cache depending upon the strategy.
+
+ size_t current_size (void) const;
+ // Return the current size of the cache.
+
+ size_t total_size (void) const;
+ // Return the total size of the cache.
+
+protected:
+
+
+
+
+
+
+
+
+
+};
+
+#if defined (__ACE_INLINE__)
+# include "tao/Connection_Cache_Manager.i"
+#endif /* __ACE_INLINE__ */
+
+#include "ace/post.h"
+#endif /*TAO_CONNECTION_CACHE_MANAGER_H*/
diff --git a/TAO/tao/Connection_Cache_Manager.i b/TAO/tao/Connection_Cache_Manager.i
new file mode 100644
index 00000000000..a61996859b0
--- /dev/null
+++ b/TAO/tao/Connection_Cache_Manager.i
@@ -0,0 +1,10 @@
+/* -*- C++ -*- */
+//$Id$
+
+
+ACE_INLINE
+TAO_Connection_Cache_Hash_Manager::
+ TAO_Connection_Cache_Hash_Manager (void)
+ : TAO_Connection_Cache_Manager ()
+{
+}
diff --git a/TAO/tao/Connection_Handler.cpp b/TAO/tao/Connection_Handler.cpp
index 7aa55d352e1..ce52fdb6da6 100644
--- a/TAO/tao/Connection_Handler.cpp
+++ b/TAO/tao/Connection_Handler.cpp
@@ -10,6 +10,8 @@
#include "tao/Connection_Handler.i"
#endif /* __ACE_INLINE__ */
+ACE_RCSID(tao, Connection_Handler, "$Id$")
+
TAO_Connection_Handler::TAO_Connection_Handler (TAO_ORB_Core *orb_core)
:orb_core_ (orb_core),
tss_resources_ (orb_core->get_tss_resources ())
diff --git a/TAO/tao/IIOP_Connect.h b/TAO/tao/IIOP_Connect.h
index 0fdb72d35d7..144d05cf731 100644
--- a/TAO/tao/IIOP_Connect.h
+++ b/TAO/tao/IIOP_Connect.h
@@ -125,6 +125,7 @@ protected:
// TCP configuration for this connection.
private:
+
virtual int handle_input_i (ACE_HANDLE = ACE_INVALID_HANDLE,
ACE_Time_Value *max_wait_time = 0);
// Will not be called at all. As a matter of fact should not be
diff --git a/TAO/tao/Makefile b/TAO/tao/Makefile
index d197c4f3087..c8d2f27f0d0 100644
--- a/TAO/tao/Makefile
+++ b/TAO/tao/Makefile
@@ -91,6 +91,7 @@ PLUGGABLE_PROTOCOLS_FILES = \
Profile \
Endpoint \
Connector_Registry \
+ Connection_Handler \
Acceptor_Registry \
Protocol_Factory \
Acceptor_Filter \
diff --git a/TAO/tao/UIOP_Connect.cpp b/TAO/tao/UIOP_Connect.cpp
index 50e2de2355c..decb6a37bbb 100644
--- a/TAO/tao/UIOP_Connect.cpp
+++ b/TAO/tao/UIOP_Connect.cpp
@@ -74,11 +74,9 @@ TAO_UIOP_Handler_Base::TAO_UIOP_Handler_Base (ACE_Thread_Manager *t)
TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (ACE_Thread_Manager *t)
: TAO_UIOP_Handler_Base (t),
+ TAO_Connection_Handler (0),
transport_ (this, 0),
- orb_core_ (0),
- tss_resources_ (0),
refcount_ (1),
- lite_flag_ (0),
uiop_properties_ (0)
{
// This constructor should *never* get called, it is just here to
@@ -86,22 +84,20 @@ TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (ACE_Thre
// Creation_Strategy requires a constructor with that signature, we
// don't use that implementation, but some (most?) compilers
// instantiate it anyway.
- ACE_ASSERT (this->orb_core_ != 0);
+ ACE_ASSERT (this->orb_core () != 0);
}
TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (TAO_ORB_Core *orb_core,
- CORBA::Boolean flag,
+ CORBA::Boolean lite_flag,
void *arg)
: TAO_UIOP_Handler_Base (orb_core),
+ TAO_Connection_Handler (orb_core),
transport_ (this, orb_core),
- orb_core_ (orb_core),
- tss_resources_ (orb_core->get_tss_resources ()),
refcount_ (1),
- lite_flag_ (flag),
uiop_properties_ (ACE_static_cast
(TAO_UIOP_Handler_Base::UIOP_Properties *, arg))
{
- if (lite_flag_)
+ if (lite_flag)
{
ACE_NEW (this->acceptor_factory_,
TAO_GIOP_Message_Lite (orb_core));
@@ -122,28 +118,10 @@ TAO_UIOP_Server_Connection_Handler::~TAO_UIOP_Server_Connection_Handler (void)
int
TAO_UIOP_Server_Connection_Handler::open (void*)
{
-#if !defined (ACE_LACKS_SOCKET_BUFSIZ)
-
- if (this->peer ().set_option (SOL_SOCKET,
- SO_SNDBUF,
- ACE_reinterpret_cast (void *,
- &uiop_properties_->send_buffer_size),
- sizeof (int)) == -1
- && errno != ENOTSUP)
+ if (this->set_socket_option (this->peer (),
+ uiop_properties_->send_buffer_size,
+ uiop_properties_->recv_buffer_size) == -1)
return -1;
- else if (this->peer ().set_option (SOL_SOCKET,
- SO_RCVBUF,
- ACE_reinterpret_cast (void *,
- &uiop_properties_->recv_buffer_size),
- sizeof (int)) == -1
- && errno != ENOTSUP)
- return -1;
-#endif /* !ACE_LACKS_SOCKET_BUFSIZ */
-
- (void) this->peer ().enable (ACE_CLOEXEC);
- // Set the close-on-exec flag for that file descriptor. If the
- // operation fails we are out of luck (some platforms do not support
- // it and return -1).
// Called by the <Strategy_Acceptor> when the handler is completely
// connected.
@@ -211,10 +189,10 @@ TAO_UIOP_Server_Connection_Handler::handle_close (ACE_HANDLE handle,
// isn't included in the set that is passed to the reactor upon
// ORB destruction.
TAO_Server_Strategy_Factory *f =
- this->orb_core_->server_factory ();
+ this->orb_core ()->server_factory ();
if (f->activate_server_connections () == 0)
- (void) this->orb_core_->remove_handle (handle);
+ (void) this->orb_core ()->remove_handle (handle);
return TAO_UIOP_SVC_HANDLER::handle_close (handle, rm);
}
@@ -227,59 +205,10 @@ TAO_UIOP_Server_Connection_Handler::svc (void)
{
// This method is called when an instance is "activated", i.e.,
// turned into an active object. Presumably, activation spawns a
- // thread with this method as the "worker function."
- int result = 0;
-
- // Inheriting the ORB_Core tss stuff from the parent thread.
- this->orb_core_->inherit_from_parent_thread (this->tss_resources_);
-
- if (TAO_orbdebug)
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) TAO_UIOP_Server_Connection_Handler::svc begin\n"));
-
- // Here we simply synthesize the "typical" event loop one might find
- // in a reactive handler, except that this can simply block waiting
- // for input.
+ // thread with this method as the "worker function".
- ACE_Time_Value *max_wait_time = 0;
- ACE_Time_Value timeout;
- ACE_Time_Value current_timeout;
- if (this->orb_core_->thread_per_connection_timeout (timeout))
- {
- current_timeout = timeout;
- max_wait_time = &current_timeout;
- }
-
- while (!this->orb_core_->has_shutdown ()
- && result >= 0)
- {
- result = handle_input_i (ACE_INVALID_HANDLE, max_wait_time);
-
- if (result == -1 && errno == ETIME)
- {
- // Ignore timeouts, they are only used to wake up and
- // shutdown.
- result = 0;
-
- // Reset errno to make sure we don't trip over an old value
- // of errno in case it is not reset when the recv() call
- // fails if the socket has been closed.
- errno = 0;
- }
-
- current_timeout = timeout;
-
- if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("TAO (%P|%t) UIOP_Server_Connection_Handler::svc - ")
- ACE_TEXT ("loop <%d>\n"), current_timeout.msec ()));
- }
-
- if (TAO_orbdebug)
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) TAO_UIOP_Server_Connection_Handler::svc end\n"));
-
- return result;
+ // Call the implementation here
+ return this->svc_i ();
}
int
@@ -296,7 +225,7 @@ TAO_UIOP_Server_Connection_Handler::handle_input_i (ACE_HANDLE,
int result =
this->acceptor_factory_->handle_input (this->transport (),
- this->orb_core_,
+ this->orb_core (),
this->transport_.message_state_,
max_wait_time);
@@ -334,14 +263,14 @@ TAO_UIOP_Server_Connection_Handler::handle_input_i (ACE_HANDLE,
// Steal the input CDR from the message state.
TAO_InputCDR input_cdr (ACE_InputCDR::Transfer_Contents (ms.cdr),
- this->orb_core_);
+ this->orb_core ());
// Reset the message state.
this->transport_.message_state_.reset (0);
result =
this->acceptor_factory_->process_client_message (this->transport (),
- this->orb_core_,
+ this->orb_core (),
input_cdr,
message_type);
@@ -360,13 +289,12 @@ TAO_UIOP_Server_Connection_Handler::handle_input_i (ACE_HANDLE,
TAO_UIOP_Client_Connection_Handler::
TAO_UIOP_Client_Connection_Handler (ACE_Thread_Manager *t)
: TAO_UIOP_Handler_Base (t),
+ TAO_Connection_Handler (0),
transport_ (this, 0),
- orb_core_ (0),
- lite_flag_ (0),
uiop_properties_ (0)
{
// This constructor should *never* get called. See comments in .h
- ACE_ASSERT (this->orb_core_ != 0);
+ ACE_ASSERT (this->orb_core () != 0);
}
TAO_UIOP_Client_Connection_Handler::
@@ -375,9 +303,8 @@ TAO_UIOP_Client_Connection_Handler (ACE_Thread_Manager *t,
CORBA::Boolean flag,
void *arg)
: TAO_UIOP_Handler_Base (t),
+ TAO_Connection_Handler (orb_core),
transport_ (this, orb_core),
- orb_core_ (orb_core),
- lite_flag_ (flag),
uiop_properties_ (ACE_static_cast
(TAO_UIOP_Handler_Base::UIOP_Properties *, arg))
{
@@ -400,25 +327,11 @@ TAO_UIOP_Client_Connection_Handler::~TAO_UIOP_Client_Connection_Handler (void)
int
TAO_UIOP_Client_Connection_Handler::open (void *)
{
-#if !defined (ACE_LACKS_SOCKET_BUFSIZ)
-
- if (this->peer ().set_option (SOL_SOCKET,
- SO_SNDBUF,
- ACE_reinterpret_cast (void *,
- &uiop_properties_->send_buffer_size),
- sizeof (int)) == -1
- && errno != ENOTSUP)
+ if (this->set_socket_option (this->peer (),
+ uiop_properties_->send_buffer_size,
+ uiop_properties_->recv_buffer_size) == -1)
return -1;
- else if (this->peer ().set_option (SOL_SOCKET,
- SO_RCVBUF,
- ACE_reinterpret_cast (void *,
- &uiop_properties_->recv_buffer_size),
- sizeof (int)) == -1
- && errno != ENOTSUP)
- return -1;
-#endif /* ACE_LACKS_SOCKET_BUFSIZ */
- (void) this->peer ().enable (ACE_CLOEXEC);
// Set the close-on-exec flag for that file descriptor. If the
// operation fails we are out of luck (some platforms do not support
// it and return -1).
@@ -458,39 +371,20 @@ TAO_UIOP_Client_Connection_Handler::handle_input (ACE_HANDLE)
}
int
-TAO_UIOP_Client_Connection_Handler::handle_timeout (const ACE_Time_Value &,
- const void *)
+TAO_UIOP_Client_Connection_Handler::handle_input_i (ACE_HANDLE,
+ ACE_Time_Value *)
{
- //
- // This method is called when buffering timer expires.
- //
-
- ACE_Time_Value *max_wait_time = 0;
-
-#if (TAO_HAS_RELATIVE_ROUNDTRIP_TIMEOUT_POLICY == 1)
-
- TAO_RelativeRoundtripTimeoutPolicy *timeout_policy =
- this->orb_core_->stubless_relative_roundtrip_timeout ();
-
- // Automatically release the policy
- CORBA::Object_var auto_release = timeout_policy;
-
- ACE_Time_Value max_wait_time_value;
+ ACE_NOTSUP_RETURN (-1);
+}
- // If max_wait_time is not zero then this is not the first attempt
- // to send the request, the timeout value includes *all* those
- // attempts.
- if (timeout_policy != 0)
- {
- timeout_policy->set_time_value (max_wait_time_value);
- max_wait_time = &max_wait_time_value;
- }
-#endif /* TAO_HAS_RELATIVE_ROUNDTRIP_TIMEOUT_POLICY == 1 */
+int
+TAO_UIOP_Client_Connection_Handler::handle_timeout (const ACE_Time_Value &val,
+ const void *ptr)
+{
// Cannot deal with errors, and therefore they are ignored.
- this->transport ()->send_buffered_messages (max_wait_time);
-
+ this->transport ()->send_buffered_messages (this->handle_timeout_i (val, ptr));
return 0;
}
@@ -548,19 +442,9 @@ TAO_UIOP_Client_Connection_Handler::handle_close_i (ACE_HANDLE handle,
int
TAO_UIOP_Client_Connection_Handler::handle_cleanup (void)
{
- // Deregister this handler with the ACE_Reactor.
- if (this->reactor ())
- {
- ACE_Reactor_Mask mask =
- ACE_Event_Handler::ALL_EVENTS_MASK | ACE_Event_Handler::DONT_CALL;
-
- // Make sure there are no timers.
- this->reactor ()->cancel_timer (this);
-
- // Remove self from reactor.
- this->reactor ()->remove_handler (this, mask);
- }
-
+ // Call the implementation.
+ this->handle_cleanup_i (this->reactor (),
+ this);
this->peer ().close ();
return 0;
diff --git a/TAO/tao/UIOP_Connect.h b/TAO/tao/UIOP_Connect.h
index 6cb238cc25e..e223136d849 100644
--- a/TAO/tao/UIOP_Connect.h
+++ b/TAO/tao/UIOP_Connect.h
@@ -33,13 +33,12 @@
#include "ace/Synch.h"
#include "ace/Svc_Handler.h"
+#include "tao/Connection_Handler.h"
#include "tao/corbafwd.h"
#include "tao/Wait_Strategy.h"
// Forward Decls
-class TAO_ORB_Core;
-class TAO_ORB_Core_TSS_Resources;
class TAO_Pluggable_Messaging;
typedef ACE_Svc_Handler<ACE_LSOCK_STREAM, ACE_NULL_SYNCH>
@@ -66,7 +65,8 @@ public:
// ****************************************************************
-class TAO_Export TAO_UIOP_Client_Connection_Handler : public TAO_UIOP_Handler_Base
+class TAO_Export TAO_UIOP_Client_Connection_Handler : public TAO_UIOP_Handler_Base,
+ public TAO_Connection_Handler
{
// = TITLE
// <Svc_Handler> used on the client side and returned by the
@@ -123,19 +123,22 @@ protected:
TAO_UIOP_Client_Transport transport_;
// Reference to the transport object, it is owned by this class.
- TAO_ORB_Core *orb_core_;
- // Cached ORB Core.
-
- CORBA::Boolean lite_flag_;
- // Are we usinglite?
-
UIOP_Properties *uiop_properties_;
// UIOP configuration properties for this connection.
+
+private:
+
+ virtual int handle_input_i (ACE_HANDLE = ACE_INVALID_HANDLE,
+ ACE_Time_Value *max_wait_time = 0);
+ // Will not be called at all. As a matter of fact should not be
+ // called. This is just to override the pure virtual function in the
+ // TAO_Connection_Handler class
};
// ****************************************************************
-class TAO_Export TAO_UIOP_Server_Connection_Handler : public TAO_UIOP_Handler_Base
+class TAO_Export TAO_UIOP_Server_Connection_Handler : public TAO_UIOP_Handler_Base,
+ public TAO_Connection_Handler
{
// = TITLE
// Handles requests on a single connection in a server.
@@ -176,6 +179,7 @@ public:
TAO_Transport *transport (void);
protected:
+
TAO_UIOP_Server_Transport transport_;
// @@ New transport object reference.
@@ -197,21 +201,12 @@ protected:
ACE_Reactor_Mask = ACE_Event_Handler::NULL_MASK);
// Perform appropriate closing.
- TAO_ORB_Core *orb_core_;
- // Cached the ORB Core.
-
- TAO_ORB_Core_TSS_Resources *tss_resources_;
- // Cached tss resources of the ORB that activated this object.
-
u_long refcount_;
// Reference count. It is used to count nested upcalls on this
// svc_handler i.e., the connection can close during nested upcalls,
// you should not delete the svc_handler until the stack unwinds
// from the nested upcalls.
- CORBA::Boolean lite_flag_;
- // Should we use GIOP or GIOPlite
-
UIOP_Properties *uiop_properties_;
// UIOP configuration properties for this connection.
};