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 /java/src/Ice/ConnectionI.java | |
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 'java/src/Ice/ConnectionI.java')
-rw-r--r-- | java/src/Ice/ConnectionI.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/java/src/Ice/ConnectionI.java b/java/src/Ice/ConnectionI.java index 3e8c735a99d..c835e398735 100644 --- a/java/src/Ice/ConnectionI.java +++ b/java/src/Ice/ConnectionI.java @@ -893,11 +893,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne _monitor.remove(this); } _monitor = _monitor.acm(timeout, close, heartbeat); - if(_state == StateActive) - { - _monitor.add(this); - } - + if(_monitor.getACM().timeout <= 0) { _acmLastActivity = -1; // Disable the recording of last activity. @@ -906,6 +902,12 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne { _acmLastActivity = IceInternal.Time.currentMonotonicTimeMillis(); } + + if(_state == StateActive) + { + _monitor.add(this); + } + } } @@ -2066,11 +2068,11 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne { if(state == StateActive) { - _monitor.add(this); if(_acmLastActivity > 0) { _acmLastActivity = IceInternal.Time.currentMonotonicTimeMillis(); } + _monitor.add(this); } else if(_state == StateActive) { |