diff --git a/nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/socket/EndpointConnectionPool.java b/nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/socket/EndpointConnectionPool.java index 0dde17dca7..1990a22fdf 100644 --- a/nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/socket/EndpointConnectionPool.java +++ b/nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/socket/EndpointConnectionPool.java @@ -708,7 +708,10 @@ public class EndpointConnectionPool { throw new IOException(ex); } } else { - final SocketChannel socketChannel = SocketChannel.open(new InetSocketAddress(hostname, port)); + final SocketChannel socketChannel = SocketChannel.open(); + socketChannel.socket().connect(new InetSocketAddress(hostname, port), commsTimeout); + socketChannel.socket().setSoTimeout(commsTimeout); + commsSession = new SocketChannelCommunicationsSession(socketChannel, destinationUri); }