diff options
author | Benoit Foucher <benoit@zeroc.com> | 2014-10-01 08:57:10 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2014-10-01 08:57:10 +0200 |
commit | 1411b8ab7c670e72a867ebbec283c0983622ea73 (patch) | |
tree | 823b647b81d61b3cb45e81b9b4753871fa5fbd99 /java/src/Ice/ConnectionI.java | |
parent | Fixed icegridadmin client default SSL port number for IceGrid (diff) | |
download | ice-1411b8ab7c670e72a867ebbec283c0983622ea73.tar.bz2 ice-1411b8ab7c670e72a867ebbec283c0983622ea73.tar.xz ice-1411b8ab7c670e72a867ebbec283c0983622ea73.zip |
Fixed Connection.setACM to check for the connection state
Diffstat (limited to 'java/src/Ice/ConnectionI.java')
-rw-r--r-- | java/src/Ice/ConnectionI.java | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/java/src/Ice/ConnectionI.java b/java/src/Ice/ConnectionI.java index ce29b34db9a..58f3f043ad4 100644 --- a/java/src/Ice/ConnectionI.java +++ b/java/src/Ice/ConnectionI.java @@ -752,29 +752,29 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne synchronized public void setACM(Ice.IntOptional timeout, Ice.Optional<ACMClose> close, Ice.Optional<ACMHeartbeat> heartbeat) { - if(_monitor != null) + if(_monitor == null || _state >= StateClosed) { - if(_state == StateActive) - { - _monitor.remove(this); - } - _monitor = _monitor.acm(timeout, close, heartbeat); - - if(_monitor.getACM().timeout <= 0) - { - _acmLastActivity = -1; // Disable the recording of last - // activity. - } - else if(_state == StateActive && _acmLastActivity == -1) - { - _acmLastActivity = IceInternal.Time.currentMonotonicTimeMillis(); - } - - if(_state == StateActive) - { - _monitor.add(this); - } + return; + } + if(_state == StateActive) + { + _monitor.remove(this); + } + _monitor = _monitor.acm(timeout, close, heartbeat); + + if(_monitor.getACM().timeout <= 0) + { + _acmLastActivity = -1; // Disable the recording of last activity. + } + else if(_state == StateActive && _acmLastActivity == -1) + { + _acmLastActivity = IceInternal.Time.currentMonotonicTimeMillis(); + } + + if(_state == StateActive) + { + _monitor.add(this); } } |