ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: gg-10115
Date Fri, 17 Apr 2015 12:46:17 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/gg-10115 [created] 3806c175c


gg-10115


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/3806c175
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/3806c175
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/3806c175

Branch: refs/heads/gg-10115
Commit: 3806c175c3ea4e45ff3d514bf28c602bd753f8bd
Parents: 77b802c
Author: Artem Shutak <ashutak@gridgain.com>
Authored: Fri Apr 17 15:46:15 2015 +0300
Committer: Artem Shutak <ashutak@gridgain.com>
Committed: Fri Apr 17 15:46:15 2015 +0300

----------------------------------------------------------------------
 .../client/impl/connection/GridClientNioTcpConnection.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3806c175/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java
b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java
index 1f70385..0a91f58 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/client/impl/connection/GridClientNioTcpConnection.java
@@ -164,7 +164,11 @@ public class GridClientNioTcpConnection extends GridClientConnection
{
             sock.setTcpNoDelay(tcpNoDelay);
             sock.setKeepAlive(true);
 
+            final long startConnTime = System.currentTimeMillis();
+            
             sock.connect(srvAddr, connectTimeout);
+            
+            final long connTimeoutRest = connectTimeout - (System.currentTimeMillis() - startConnTime);
 
             GridClientFuture<?> handshakeFut = new GridClientFutureAdapter<>();
 
@@ -199,7 +203,7 @@ public class GridClientNioTcpConnection extends GridClientConnection {
 
             ses.send(req);
 
-            handshakeFut.get();
+            handshakeFut.get(connTimeoutRest, TimeUnit.MILLISECONDS);
 
             ses.addMeta(SES_META_CONN, this);
 


Mime
View raw message