summaryrefslogtreecommitdiff
path: root/TAO/tao/LF_CH_Event.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/LF_CH_Event.cpp')
-rw-r--r--TAO/tao/LF_CH_Event.cpp34
1 files changed, 26 insertions, 8 deletions
diff --git a/TAO/tao/LF_CH_Event.cpp b/TAO/tao/LF_CH_Event.cpp
index 45f6596d31b..f4e1551b881 100644
--- a/TAO/tao/LF_CH_Event.cpp
+++ b/TAO/tao/LF_CH_Event.cpp
@@ -48,14 +48,31 @@ TAO_LF_CH_Event::state_changed_i (int new_state)
}
else if (this->state_ == TAO_LF_Event::LFS_SUCCESS)
{
- if (new_state == TAO_LF_Event::LFS_CONNECTION_CLOSED)
+ if (new_state == TAO_LF_Event::LFS_CONNECTION_CLOSE_WAIT
+ || new_state == TAO_LF_Event::LFS_CONNECTION_CLOSED)
{
this->prev_state_ = this->state_;
this->state_ = new_state;
}
return;
}
-
+ else if (this->state_ == TAO_LF_Event::LFS_CONNECTION_CLOSE_WAIT)
+ {
+ if (new_state == TAO_LF_Event::LFS_CONNECTION_CLOSED)
+ {
+ // Dont reset the previous state. We could have come only
+ // from SUCESS. Let that state be preserved.
+ this->state_ = new_state;
+ }
+ }
+ else if (this->state_ == TAO_LF_Event::LFS_TIMEOUT)
+ {
+ if (new_state == TAO_LF_Event::LFS_CONNECTION_CLOSED)
+ {
+ // Dont reset the previous state
+ this->state_ = new_state;
+ }
+ }
return;
}
@@ -65,10 +82,8 @@ TAO_LF_CH_Event::successful (void) const
{
if (this->prev_state_ == TAO_LF_Event::LFS_CONNECTION_WAIT)
return this->state_ == TAO_LF_Event::LFS_SUCCESS;
- else if (this->prev_state_ == TAO_LF_Event::LFS_SUCCESS)
- return this->state_ == TAO_LF_Event::LFS_CONNECTION_CLOSED;
- return 0;
+ return this->state_ == TAO_LF_Event::LFS_CONNECTION_CLOSED;
}
int
@@ -76,7 +91,7 @@ TAO_LF_CH_Event::error_detected (void) const
{
if (this->prev_state_ == TAO_LF_Event::LFS_CONNECTION_WAIT)
return this->state_ == TAO_LF_Event::LFS_CONNECTION_CLOSED;
- else if (this->prev_state_ == TAO_LF_Event::LFS_SUCCESS)
+ else if (this->prev_state_ == TAO_LF_Event::LFS_CONNECTION_CLOSE_WAIT)
return (this->state_ != TAO_LF_Event::LFS_CONNECTION_CLOSED);
return 0;
@@ -85,8 +100,11 @@ TAO_LF_CH_Event::error_detected (void) const
void
TAO_LF_CH_Event::set_state (int new_state)
{
- this->prev_state_ = this->state_;
- this->state_ = new_state;
+ if (this->is_state_final () == 0
+ && new_state == TAO_LF_Event::LFS_TIMEOUT)
+ {
+ this->state_ = new_state;
+ }
}