diff --git a/src/org/jgroups/blocks/cs/NioBaseServer.java b/src/org/jgroups/blocks/cs/NioBaseServer.java index 4b1056e9440..4f3faec6f47 100644 --- a/src/org/jgroups/blocks/cs/NioBaseServer.java +++ b/src/org/jgroups/blocks/cs/NioBaseServer.java @@ -136,7 +136,8 @@ public void run() { // a key can be connectable *and* readable (https://issues.redhat.com/browse/JGRP-2531) if(key.isConnectable()) { SocketChannel ch=(SocketChannel)key.channel(); - if(ch.finishConnect() || ch.isConnected()) { + // https://issues.redhat.com/browse/JGRP-2727 + if((ch.isConnectionPending() && ch.finishConnect()) || ch.isConnected()) { conn.clearSelectionKey(SelectionKey.OP_CONNECT); conn.connected(true); }