activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-5368 - improve nio ssl handshake performance - use soTimeout for handshake selector
Date Mon, 13 Jul 2015 11:34:31 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 18300c651 -> ad8879d28


https://issues.apache.org/jira/browse/AMQ-5368 - improve nio ssl handshake performance - use
soTimeout for handshake selector


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/ad8879d2
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/ad8879d2
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/ad8879d2

Branch: refs/heads/master
Commit: ad8879d2839bdd16e0e8202f08881dc9f2980b75
Parents: 18300c6
Author: Dejan Bosanac <dejan@nighttale.net>
Authored: Mon Jul 13 13:34:08 2015 +0200
Committer: Dejan Bosanac <dejan@nighttale.net>
Committed: Mon Jul 13 13:34:22 2015 +0200

----------------------------------------------------------------------
 .../java/org/apache/activemq/transport/nio/NIOSSLTransport.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/ad8879d2/activemq-client/src/main/java/org/apache/activemq/transport/nio/NIOSSLTransport.java
----------------------------------------------------------------------
diff --git a/activemq-client/src/main/java/org/apache/activemq/transport/nio/NIOSSLTransport.java
b/activemq-client/src/main/java/org/apache/activemq/transport/nio/NIOSSLTransport.java
index 5b8f869..6b8a446 100644
--- a/activemq-client/src/main/java/org/apache/activemq/transport/nio/NIOSSLTransport.java
+++ b/activemq-client/src/main/java/org/apache/activemq/transport/nio/NIOSSLTransport.java
@@ -348,7 +348,6 @@ public class NIOSSLTransport extends NIOTransport {
         Selector selector = null;
         SelectionKey key = null;
         boolean readable = true;
-        int timeout = 100;
         try {
             while (true) {
                 HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus();
@@ -365,8 +364,8 @@ public class NIOSSLTransport extends NIOTransport {
                             } else {
                                 key.interestOps(SelectionKey.OP_READ);
                             }
-                            int keyCount = selector.select(timeout);
-                            if (keyCount == 0 && ((System.currentTimeMillis() - now)
>= timeout)) {
+                            int keyCount = selector.select(this.getSoTimeout());
+                            if (keyCount == 0 && this.getSoTimeout() > 0 &&
((System.currentTimeMillis() - now) >= this.getSoTimeout())) {
                                 throw new SocketTimeoutException("Timeout during handshake");
                             }
                             readable = key.isReadable();


Mime
View raw message