GH-3589: Reduce Delay on NIO Connection

Resolves https://github.com/spring-projects/spring-integration/issues/3589
This commit is contained in:
Gary Russell
2021-07-15 11:43:16 -04:00
parent 1d769b8e9d
commit e714f693cf

View File

@@ -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");