mirror of
https://github.com/corda/corda.git
synced 2025-06-16 06:08:13 +00:00
implement non-blocking socket connections
This commit is contained in:
@ -13,8 +13,8 @@ package java.nio.channels;
|
||||
public class SelectionKey {
|
||||
public static final int OP_READ = 1 << 0;
|
||||
public static final int OP_WRITE = 1 << 2;
|
||||
public static final int OP_CONNECT = 1 << 3;
|
||||
public static final int OP_ACCEPT = 1 << 4;
|
||||
// public static final int OP_CONNECT = 1 << 3;
|
||||
|
||||
private final SelectableChannel channel;
|
||||
private final Selector selector;
|
||||
@ -57,6 +57,10 @@ public class SelectionKey {
|
||||
return (readyOps & OP_WRITE) != 0;
|
||||
}
|
||||
|
||||
public boolean isConnectable() {
|
||||
return (readyOps & OP_CONNECT) != 0;
|
||||
}
|
||||
|
||||
public boolean isAcceptable() {
|
||||
return (readyOps & OP_ACCEPT) != 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user