summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2000-11-01 00:04:17 +0000
committerbala <balanatarajan@users.noreply.github.com>2000-11-01 00:04:17 +0000
commit34a5b259aa6853e0f45c7bc2390f33d1f769ed4f (patch)
tree7b0d1ba18bfc8576e931fad8c0cc3ae0727cabbf
parentfe96bc4d60ebbc0739d141b385eb22d9d3e995b5 (diff)
downloadATCD-34a5b259aa6853e0f45c7bc2390f33d1f769ed4f.tar.gz
*** empty log message ***
-rw-r--r--TAO/tao/Acceptor_Impl.cpp17
-rw-r--r--TAO/tao/Connection_Handler.cpp7
-rw-r--r--TAO/tao/Connection_Handler.h13
-rw-r--r--TAO/tao/Connection_Handler.inl15
-rw-r--r--TAO/tao/IIOP_Connect.cpp2
-rw-r--r--TAO/tao/IIOP_Connect.h3
-rw-r--r--TAO/tao/IIOP_Connector.cpp5
-rw-r--r--TAO/tao/IIOP_Connector.h5
-rw-r--r--TAO/tao/IIOP_Transport.cpp9
9 files changed, 51 insertions, 25 deletions
diff --git a/TAO/tao/Acceptor_Impl.cpp b/TAO/tao/Acceptor_Impl.cpp
index 13ad6f56780..c259a0a1b82 100644
--- a/TAO/tao/Acceptor_Impl.cpp
+++ b/TAO/tao/Acceptor_Impl.cpp
@@ -89,15 +89,14 @@ TAO_Concurrency_Strategy<SVC_HANDLER>::activate_svc_handler (SVC_HANDLER *sh,
// reactive concurrency model
- // Keep track of open connections so that they can be explicitly
- // removed from the reactor prior to shutting down the ORB. This is
- // particularly important for dynamically loaded ORBs where an
- // application level reactor, such as the Singleton reactor, is used
- // instead of an ORB created one. Register the handle (not handler)
- // associated with the connection that was just accepted with the
- // ORB Core.
- if (this->orb_core_->register_handle (sh->get_handle ()) != 0)
- return -1;
+ // Bump the reference count. This helps keeping track of the number
+ // of places the handler is registered with. This is particularly
+ // helpful when it is needed to explicitly remove them from the
+ // reactor prior to shutting down the ORB. This is particularly
+ // important for dynamically loaded ORBs where an application level
+ // reactor, such as the Singleton reactor, is used instead of an ORB
+ // created one.
+ sh->incr_ref_count ();
return this->orb_core_->reactor ()->register_handler
(sh, ACE_Event_Handler::READ_MASK);
diff --git a/TAO/tao/Connection_Handler.cpp b/TAO/tao/Connection_Handler.cpp
index 85315fa077c..7bf74b617c4 100644
--- a/TAO/tao/Connection_Handler.cpp
+++ b/TAO/tao/Connection_Handler.cpp
@@ -15,6 +15,7 @@ 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 ()),
+ ref_count_ (1),
cache_map_entry_ (0)
{
}
@@ -27,12 +28,6 @@ TAO_Connection_Handler::make_idle (void)
this->orb_core_->connection_cache ().make_idle (this->cache_map_entry_);
}
-int
-TAO_Connection_Handler::mark_closed (void)
-{
- return
- this->orb_core_->connection_cache ().mark_closed (this->cache_map_entry_);
-}
void
TAO_Connection_Handler::remove_handle (ACE_HANDLE handle)
diff --git a/TAO/tao/Connection_Handler.h b/TAO/tao/Connection_Handler.h
index 178ab491986..a7db0ee8747 100644
--- a/TAO/tao/Connection_Handler.h
+++ b/TAO/tao/Connection_Handler.h
@@ -81,9 +81,11 @@ public:
int make_idle (void);
// Make ourselves ready for use
- int mark_closed (void);
- // Mark ourselves as closed ie. connection handler may not be valid
- // for this connection.
+ void incr_ref_count (void);
+ // Increment the reference count
+
+ void decr_ref_count (void);
+ // Decrement the refernce count
protected:
@@ -121,6 +123,7 @@ protected:
// Implementation of the call handle_cleanup () in
// Service_Handler.
+
private:
TAO_ORB_Core *orb_core_;
@@ -129,6 +132,10 @@ private:
TAO_ORB_Core_TSS_Resources *tss_resources_;
// Cached tss resources of the ORB that activated this object.
+ u_long ref_count_;
+ // Reference count to the number of external references -- ie. the
+ // count of the number of places our references are being held.
+
TAO_Connection_Cache_Manager::HASH_MAP_ENTRY *cache_map_entry_;
// The cache map entry -- where we are in the Connection Cache
};
diff --git a/TAO/tao/Connection_Handler.inl b/TAO/tao/Connection_Handler.inl
index 16f1cc132d2..c37d6bd300a 100644
--- a/TAO/tao/Connection_Handler.inl
+++ b/TAO/tao/Connection_Handler.inl
@@ -27,6 +27,21 @@ TAO_Connection_Handler::cache_map_entry (
this->cache_map_entry_ = entry;
}
+ACE_INLINE void
+TAO_Connection_Handler::incr_ref_count (void)
+{
+ this->ref_count_ ++;
+}
+
+ACE_INLINE void
+TAO_Connection_Handler::decr_ref_count (void)
+{
+ this->ref_count_ --;
+
+ if (this->ref_count_ == 0)
+ delete this;
+}
+
ACE_INLINE TAO_ORB_Core *
TAO_Connection_Handler::orb_core (void)
diff --git a/TAO/tao/IIOP_Connect.cpp b/TAO/tao/IIOP_Connect.cpp
index d9732139d55..5934724e9ba 100644
--- a/TAO/tao/IIOP_Connect.cpp
+++ b/TAO/tao/IIOP_Connect.cpp
@@ -343,6 +343,7 @@ TAO_IIOP_Client_Connection_Handler (ACE_Thread_Manager *t,
TAO_IIOP_Client_Connection_Handler::~TAO_IIOP_Client_Connection_Handler (void)
{
+ cout << "Are we here in dest " <<endl;
// If the socket has not already been closed.
if (this->transport_.handle () != ACE_INVALID_HANDLE)
{
@@ -411,6 +412,7 @@ TAO_IIOP_Client_Connection_Handler::open (void *)
int
TAO_IIOP_Client_Connection_Handler::close (u_long)
{
+ cout << "Do we get here " <<endl;
this->destroy ();
return 0;
diff --git a/TAO/tao/IIOP_Connect.h b/TAO/tao/IIOP_Connect.h
index 61d2a88f1b0..a4d1a6a9ce8 100644
--- a/TAO/tao/IIOP_Connect.h
+++ b/TAO/tao/IIOP_Connect.h
@@ -183,6 +183,7 @@ protected:
// Perform appropriate closing.
protected:
+
TAO_IIOP_Server_Transport transport_;
// @@ New transport object reference.
@@ -190,7 +191,7 @@ protected:
// Messaging acceptor factory
u_long refcount_;
- // Reference count. It is used to count nested upcalls on this
+ // 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.
diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp
index 121b6aba25f..fcb9a304581 100644
--- a/TAO/tao/IIOP_Connector.cpp
+++ b/TAO/tao/IIOP_Connector.cpp
@@ -130,11 +130,8 @@ TAO_IIOP_Connector::open (TAO_ORB_Core *orb_core)
int
TAO_IIOP_Connector::close (void)
{
- this->base_connector_.close ();
-
delete this->base_connector_.creation_strategy ();
-
- return 0;
+ return this->base_connector_.close ();
}
int
diff --git a/TAO/tao/IIOP_Connector.h b/TAO/tao/IIOP_Connector.h
index 16ec3ff38a4..6c9a27e71be 100644
--- a/TAO/tao/IIOP_Connector.h
+++ b/TAO/tao/IIOP_Connector.h
@@ -129,11 +129,13 @@ public:
TAO_IIOP_BASE_CONNECTOR;
protected:
+
TAO_IIOP_Properties tcp_properties_;
// TCP configuration properties to be used for all
// connections established by this connector.
private:
+
TAO_NULL_ACTIVATION_STRATEGY null_activation_strategy_;
// Our activation strategy
@@ -143,6 +145,9 @@ private:
TAO_IIOP_BASE_CONNECTOR base_connector_;
// The connector initiating connection requests for IIOP.
+ TAO_IIOP_Connect_Creation_Strategy creation_strategy_;
+ // Our creation strategy
+
CORBA::Boolean lite_flag_;
// Do we need to use a GIOP_Lite for sending messages?
};
diff --git a/TAO/tao/IIOP_Transport.cpp b/TAO/tao/IIOP_Transport.cpp
index 990c099f1fb..8d539c4a1c2 100644
--- a/TAO/tao/IIOP_Transport.cpp
+++ b/TAO/tao/IIOP_Transport.cpp
@@ -313,8 +313,13 @@ TAO_IIOP_Client_Transport::register_handler (void)
if (r == this->service_handler ()->reactor ())
return 0;
- return r->register_handler (this->service_handler (),
- ACE_Event_Handler::READ_MASK);
+ // About to be registered with the reactor, so bump the ref
+ // count
+ this->svc_handler ()->incr_ref_count ();
+
+ // Register the handler with the reactor
+ return r->register_handler (this->service_handler (),
+ ACE_Event_Handler::READ_MASK);
}