You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2015/10/30 16:47:51 UTC
qpid-jms git commit: QPIDJMS-136: use System.nanoTime() when deriving
time to tick the transport with for idle-timeout handling
Repository: qpid-jms
Updated Branches:
refs/heads/master a5240be50 -> 7c22d59e4
QPIDJMS-136: use System.nanoTime() when deriving time to tick the transport with for idle-timeout handling
Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/7c22d59e
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/7c22d59e
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/7c22d59e
Branch: refs/heads/master
Commit: 7c22d59e40253fa7915b575db8e33c33510d7a13
Parents: a5240be
Author: Robert Gemmell <ro...@apache.org>
Authored: Fri Oct 30 15:47:02 2015 +0000
Committer: Robert Gemmell <ro...@apache.org>
Committed: Fri Oct 30 15:47:02 2015 +0000
----------------------------------------------------------------------
.../java/org/apache/qpid/jms/provider/amqp/AmqpProvider.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/7c22d59e/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProvider.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProvider.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProvider.java
index 0ec1fad..415db33 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProvider.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/provider/amqp/AmqpProvider.java
@@ -875,7 +875,8 @@ public class AmqpProvider implements Provider, TransportListener , AmqpResourceP
// The request onSuccess calls this method
connectionOpenRequest = null;
- long now = System.currentTimeMillis();
+ // Using nano time since it is not related to the wall clock, which may change
+ long now = TimeUnit.NANOSECONDS.toMillis(System.nanoTime());
long deadline = protonTransport.tick(now);
if (deadline > 0) {
long delay = deadline - now;
@@ -1139,7 +1140,8 @@ public class AmqpProvider implements Provider, TransportListener , AmqpResourceP
boolean checkScheduled = false;
if (connection.getLocalState() == EndpointState.ACTIVE) {
- long now = System.currentTimeMillis();
+ // Using nano time since it is not related to the wall clock, which may change
+ long now = TimeUnit.NANOSECONDS.toMillis(System.nanoTime());
long deadline = protonTransport.tick(now);
boolean pumpSucceeded = pumpToProtonTransport();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org