From e714f693cf245ed865ab3c51a0558b0ebfb81a97 Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Thu, 15 Jul 2021 11:43:16 -0400 Subject: [PATCH] GH-3589: Reduce Delay on NIO Connection Resolves https://github.com/spring-projects/spring-integration/issues/3589 --- .../ip/tcp/connection/TcpNioClientConnectionFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioClientConnectionFactory.java b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioClientConnectionFactory.java index fb923c5b31..b5485add18 100644 --- a/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioClientConnectionFactory.java +++ b/spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpNioClientConnectionFactory.java @@ -122,9 +122,9 @@ public class TcpNioClientConnectionFactory extends boolean connected = socketChannel.finishConnect(); long timeLeft = getConnectTimeout().toMillis(); while (!connected && timeLeft > 0) { - Thread.sleep(50); // NOSONAR Magic # + Thread.sleep(5); // NOSONAR Magic # connected = socketChannel.finishConnect(); - timeLeft -= 50; // NOSONAR Magic # + timeLeft -= 5; // NOSONAR Magic # } if (!connected) { throw new IOException("Not connected after connectTimeout");