summaryrefslogtreecommitdiff
path: root/TAO/tao
diff options
context:
space:
mode:
authorbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-12-04 02:32:43 +0000
committerbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-12-04 02:32:43 +0000
commit3c9381c70e44f744b9c23bb2907f31012b8b5b5e (patch)
treea892e13a0e1ea18cfeb59b1acd52719cb35a6af6 /TAO/tao
parenta2c7e092cffa8223172429262826cb7f856bad75 (diff)
downloadATCD-3c9381c70e44f744b9c23bb2907f31012b8b5b5e.tar.gz
ChangeLogTag: Tue Dec 3 21:27:52 2002 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu>
Diffstat (limited to 'TAO/tao')
-rw-r--r--TAO/tao/Blocked_Connect_Strategy.cpp15
-rw-r--r--TAO/tao/Blocked_Connect_Strategy.h1
-rw-r--r--TAO/tao/Connect_Strategy.cpp22
-rw-r--r--TAO/tao/Connect_Strategy.h8
-rw-r--r--TAO/tao/LF_Connect_Strategy.cpp24
-rw-r--r--TAO/tao/LF_Connect_Strategy.h1
-rw-r--r--TAO/tao/Reactive_Connect_Strategy.cpp21
-rw-r--r--TAO/tao/Reactive_Connect_Strategy.h1
8 files changed, 26 insertions, 67 deletions
diff --git a/TAO/tao/Blocked_Connect_Strategy.cpp b/TAO/tao/Blocked_Connect_Strategy.cpp
index 37cf91e9efa..d244508e7e8 100644
--- a/TAO/tao/Blocked_Connect_Strategy.cpp
+++ b/TAO/tao/Blocked_Connect_Strategy.cpp
@@ -45,18 +45,3 @@ TAO_Blocked_Connect_Strategy::wait (TAO_Connection_Handler *,
// We cannot wait for connection completion
return -1;
}
-
-int
-TAO_Blocked_Connect_Strategy::post_failed_connect (TAO_Connection_Handler *ch)
-{
- // We need to do this here else we will leak memory. We cannot call
- // close_connection () for the following reasons
- // . in blocked connect the event_handlers get_handle () will return
- // an ACE_INVALID_HANDLE
- // . We cannot relax the conditions since the conditions are right
- // for other natural cases ie. LF
- // Hence the blocked startegy will have to take of things itself.
- ch->transport (0);
- int ref = ch->decr_refcount ();
- return ref;
-}
diff --git a/TAO/tao/Blocked_Connect_Strategy.h b/TAO/tao/Blocked_Connect_Strategy.h
index cefe6989442..7e4981a9002 100644
--- a/TAO/tao/Blocked_Connect_Strategy.h
+++ b/TAO/tao/Blocked_Connect_Strategy.h
@@ -47,7 +47,6 @@ public:
virtual int wait (TAO_Connection_Handler *ch,
ACE_Time_Value *val);
- virtual int post_failed_connect (TAO_Connection_Handler *ch);
};
diff --git a/TAO/tao/Connect_Strategy.cpp b/TAO/tao/Connect_Strategy.cpp
index 85e6cd3d641..113b7c66d65 100644
--- a/TAO/tao/Connect_Strategy.cpp
+++ b/TAO/tao/Connect_Strategy.cpp
@@ -1,4 +1,5 @@
#include "Connect_Strategy.h"
+#include "Connection_Handler.h"
ACE_RCSID(tao,
@@ -16,7 +17,24 @@ TAO_Connect_Strategy::~TAO_Connect_Strategy (void)
}
int
-TAO_Connect_Strategy::post_failed_connect (TAO_Connection_Handler * /*ch*/)
+TAO_Connect_Strategy::post_failed_connect (TAO_Connection_Handler *ch,
+ int is_successful)
{
- return 0;
+ int ref = 0;
+ if (!is_successful)
+ {
+ // We need to do this here else we will leak memory. We cannot call
+ // close_connection () for the following reasons
+ // . the event_handlers get_handle () will return an
+ // ACE_INVALID_HANDLE as things havent been shutdown
+ // properly.
+ // . We cannot relax the conditions since the conditions are right
+ // for other natural cases ie. LF
+ // Under these odd circumstances we need to take care of things
+ // ourseleves
+ ch->transport (0);
+ ref = ch->decr_refcount ();
+ }
+
+ return ref;
}
diff --git a/TAO/tao/Connect_Strategy.h b/TAO/tao/Connect_Strategy.h
index 6638f118511..369dad254f1 100644
--- a/TAO/tao/Connect_Strategy.h
+++ b/TAO/tao/Connect_Strategy.h
@@ -66,11 +66,15 @@ public:
virtual int wait (TAO_Connection_Handler *ch,
ACE_Time_Value *val) = 0;
+ /// Cleanup in case of failed connect.
/*
* Do any left over memory management or related things after
- * the connect failed.
+ * the connect failed. The argument @c is_successful indicates
+ * whether the connection handler had undergone a sucessful state
+ * transitions or not.
*/
- virtual int post_failed_connect (TAO_Connection_Handler *ch);
+ virtual int post_failed_connect (TAO_Connection_Handler *ch,
+ int is_successful = 1);
protected:
diff --git a/TAO/tao/LF_Connect_Strategy.cpp b/TAO/tao/LF_Connect_Strategy.cpp
index ddd3762cf84..e20cc3b3aa0 100644
--- a/TAO/tao/LF_Connect_Strategy.cpp
+++ b/TAO/tao/LF_Connect_Strategy.cpp
@@ -92,27 +92,3 @@ TAO_LF_Connect_Strategy::wait (TAO_Connection_Handler *ch,
return result;
}
-
-
-
-
-int
-TAO_LF_Connect_Strategy::post_failed_connect (TAO_Connection_Handler *ch)
-{
- int ref = 0;
- if (!ch->successful ())
- {
- // We need to do this here else we will leak memory. We cannot call
- // close_connection () for the following reasons
- // . the event_handlers get_handle () will return could return
- // an ACE_INVALID_HANDLE is things havent been shutdown
- // properly.
- // . We cannot relax the conditions since the conditions are right
- // for other natural cases ie. LF
- // Hence the blocked startegy will have to take of things itself.
- ch->transport (0);
- ref = ch->decr_refcount ();
- }
-
- return ref;
-}
diff --git a/TAO/tao/LF_Connect_Strategy.h b/TAO/tao/LF_Connect_Strategy.h
index cf2e27aca49..0784541bf25 100644
--- a/TAO/tao/LF_Connect_Strategy.h
+++ b/TAO/tao/LF_Connect_Strategy.h
@@ -50,7 +50,6 @@ public:
virtual int wait (TAO_Connection_Handler *ch,
ACE_Time_Value *val);
- virtual int post_failed_connect (TAO_Connection_Handler *ch);
};
diff --git a/TAO/tao/Reactive_Connect_Strategy.cpp b/TAO/tao/Reactive_Connect_Strategy.cpp
index 83b090e5b24..3f7cd98b4b8 100644
--- a/TAO/tao/Reactive_Connect_Strategy.cpp
+++ b/TAO/tao/Reactive_Connect_Strategy.cpp
@@ -76,24 +76,3 @@ TAO_Reactive_Connect_Strategy::wait (TAO_Connection_Handler *ch,
return result;
}
-
-int
-TAO_Reactive_Connect_Strategy::post_failed_connect (TAO_Connection_Handler *ch)
-{
- int ref = 0;
- if (!ch->successful ())
- {
- // We need to do this here else we will leak memory. We cannot call
- // close_connection () for the following reasons
- // . the event_handlers get_handle () will return could return
- // an ACE_INVALID_HANDLE is things havent been shutdown
- // properly.
- // . We cannot relax the conditions since the conditions are right
- // for other natural cases ie. LF
- // Hence the blocked startegy will have to take of things itself.
- ch->transport (0);
- ref = ch->decr_refcount ();
- }
-
- return ref;
-}
diff --git a/TAO/tao/Reactive_Connect_Strategy.h b/TAO/tao/Reactive_Connect_Strategy.h
index 01c24b491b8..ad58e1a3540 100644
--- a/TAO/tao/Reactive_Connect_Strategy.h
+++ b/TAO/tao/Reactive_Connect_Strategy.h
@@ -50,7 +50,6 @@ public:
virtual int wait (TAO_Connection_Handler *ch,
ACE_Time_Value *val);
- virtual int post_failed_connect (TAO_Connection_Handler *ch);
};
#include "ace/post.h"