mirror of
https://github.com/corda/corda.git
synced 2025-04-20 00:51:39 +00:00
check connection readyness in SocketChannel.finishConnect if necessary
This commit is contained in:
parent
eb3a9f010b
commit
39018c20e0
@ -67,11 +67,16 @@ public class SocketChannel extends SelectableChannel
|
||||
|
||||
public boolean finishConnect() throws IOException {
|
||||
if (! connected) {
|
||||
while (blocking && ! readyToConnect) {
|
||||
while (! readyToConnect) {
|
||||
Selector selector = Selector.open();
|
||||
SelectionKey key = register(selector, SelectionKey.OP_CONNECT, null);
|
||||
|
||||
selector.select();
|
||||
if (blocking) {
|
||||
selector.select();
|
||||
} else {
|
||||
selector.selectNow();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
natFinishConnect(socket);
|
||||
|
Loading…
x
Reference in New Issue
Block a user