diff options
author | Matthew Newhook <matthew@zeroc.com> | 2014-08-08 16:48:43 -0230 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2014-08-08 16:48:43 -0230 |
commit | 98a1b3ffe79fda923712c684ba08f67c2d9aed5e (patch) | |
tree | b5be1ffb57fe5923943779f396c69da7ee59434c /cpp/src/Ice/ConnectionI.cpp | |
parent | Fixed lots of warnings. (diff) | |
download | ice-98a1b3ffe79fda923712c684ba08f67c2d9aed5e.tar.bz2 ice-98a1b3ffe79fda923712c684ba08f67c2d9aed5e.tar.xz ice-98a1b3ffe79fda923712c684ba08f67c2d9aed5e.zip |
ICE-5630 - ACM timeout is broken
- Also refactored the code a bit in java so that the ACMMonitor doesn't
inherit from runnable.
Diffstat (limited to 'cpp/src/Ice/ConnectionI.cpp')
-rw-r--r-- | cpp/src/Ice/ConnectionI.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cpp/src/Ice/ConnectionI.cpp b/cpp/src/Ice/ConnectionI.cpp index 37afd228ca7..b42b8558a7f 100644 --- a/cpp/src/Ice/ConnectionI.cpp +++ b/cpp/src/Ice/ConnectionI.cpp @@ -1197,10 +1197,6 @@ Ice::ConnectionI::setACM(const IceUtil::Optional<int>& timeout, _monitor->remove(this); } _monitor = _monitor->acm(timeout, close, heartbeat); - if(_state == StateActive) - { - _monitor->add(this); - } if(_monitor->getACM().timeout <= 0) { @@ -1210,6 +1206,11 @@ Ice::ConnectionI::setACM(const IceUtil::Optional<int>& timeout, { _acmLastActivity = IceUtil::Time::now(IceUtil::Time::Monotonic); } + + if(_state == StateActive) + { + _monitor->add(this); + } } } @@ -2483,11 +2484,11 @@ Ice::ConnectionI::setState(State state) { if(state == StateActive) { - _monitor->add(this); if(_acmLastActivity != IceUtil::Time()) { _acmLastActivity = IceUtil::Time::now(IceUtil::Time::Monotonic); } + _monitor->add(this); } else if(_state == StateActive) { |