From 47aa23680004775e0e2c90c1e7bc61bb4be7ea45 Mon Sep 17 00:00:00 2001 From: Bela Ban Date: Tue, 24 Oct 2023 08:27:16 +0200 Subject: [PATCH] Fixed https://issues.redhat.com/browse/JGRP-2727 --- src/org/jgroups/blocks/cs/NioBaseServer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); }