PROTON-843: Java should match C for idle timeout As discussed on the mailing list. Currently proton-j advertises a provided local idle timeout value as-is, whereas proton-c will halve it before sending it to the remote side. The two implementations should match in behaviour.
Closes #15 (cherry picked from commit 0b439c16e72560d575bce67e5a4300d1ea89ef52) Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/b9e5d023 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/b9e5d023 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/b9e5d023 Branch: refs/heads/0.9.x Commit: b9e5d023b24fb2ce1d5e59c3e34622692bfc90c5 Parents: adef382 Author: Dominic Evans <[email protected]> Authored: Thu Apr 2 18:47:14 2015 +0100 Committer: Robert Gemmell <[email protected]> Committed: Sat Apr 25 20:24:17 2015 +0100 ---------------------------------------------------------------------- .../java/org/apache/qpid/proton/engine/impl/TransportImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b9e5d023/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java ---------------------------------------------------------------------- diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java index 852489a..b866ca8 100644 --- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java +++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/TransportImpl.java @@ -798,8 +798,11 @@ public class TransportImpl extends EndpointImpl if (_channelMax > 0) { open.setChannelMax(UnsignedShort.valueOf((short) _channelMax)); } + + // as per the recommendation in the spec, advertise half our + // actual timeout to the remote if (_localIdleTimeout > 0) { - open.setIdleTimeOut(new UnsignedInteger(_localIdleTimeout)); + open.setIdleTimeOut(new UnsignedInteger(_localIdleTimeout / 2)); } _isOpenSent = true; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
