diff options
author | Benoit Foucher <benoit@zeroc.com> | 2014-10-15 08:20:15 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2014-10-15 08:20:15 +0200 |
commit | 4c6a4a6e77eeb513e2031912698a1fa839d9065a (patch) | |
tree | fdfad1d1dceb1fcc614da334b7058efc99925703 /java/src/Ice/ConnectionI.java | |
parent | ICE-5739 missing AMD test in c++ optional (diff) | |
download | ice-4c6a4a6e77eeb513e2031912698a1fa839d9065a.tar.bz2 ice-4c6a4a6e77eeb513e2031912698a1fa839d9065a.tar.xz ice-4c6a4a6e77eeb513e2031912698a1fa839d9065a.zip |
Fixed ICE-5454: close acceptor on adapter deactivation
Diffstat (limited to 'java/src/Ice/ConnectionI.java')
-rw-r--r-- | java/src/Ice/ConnectionI.java | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/java/src/Ice/ConnectionI.java b/java/src/Ice/ConnectionI.java index 9ee6ac10121..3ed5e3eed93 100644 --- a/java/src/Ice/ConnectionI.java +++ b/java/src/Ice/ConnectionI.java @@ -1386,7 +1386,7 @@ public final class ConnectionI extends IceInternal.EventHandler } @Override - public void finished(IceInternal.ThreadPoolCurrent current) + public void finished(IceInternal.ThreadPoolCurrent current, final boolean close) { synchronized(this) { @@ -1402,7 +1402,7 @@ public final class ConnectionI extends IceInternal.EventHandler // if(_startCallback == null && _sendStreams.isEmpty() && _asyncRequests.isEmpty() && _callback == null) { - finish(); + finish(close); return; } @@ -1410,7 +1410,7 @@ public final class ConnectionI extends IceInternal.EventHandler if(!_dispatcher) // Optimization, call finish() directly if there's no // dispatcher. { - finish(); + finish(close); } else { @@ -1419,13 +1419,13 @@ public final class ConnectionI extends IceInternal.EventHandler @Override public void run() { - finish(); + finish(close); } }); } } - public void finish() + public void finish(boolean close) { if(!_initialized) { @@ -1454,6 +1454,11 @@ public final class ConnectionI extends IceInternal.EventHandler } } + if(close) + { + _transceiver.close(); + } + if(_startCallback != null) { _startCallback.connectionStartFailed(this, _exception); @@ -1874,14 +1879,21 @@ public final class ConnectionI extends IceInternal.EventHandler { return; } - _threadPool.finish(this); + + // + // Don't need to close now for connections so only close the transceiver + // if the selector request it. + // + if(_threadPool.finish(this, false)) + { + _transceiver.close(); + } break; } case StateFinished: { assert (_state == StateClosed); - _transceiver.close(); _communicator = null; break; } |