mirror of
https://github.com/corda/corda.git
synced 2025-06-17 14:48:16 +00:00
update NIO code to be more compatible with Java
This commit is contained in:
@ -16,9 +16,8 @@ import java.nio.ByteBuffer;
|
||||
public abstract class SelectableChannel implements Channel {
|
||||
private SelectionKey key;
|
||||
|
||||
public abstract int read(ByteBuffer b) throws Exception;
|
||||
public abstract int write(ByteBuffer b) throws Exception;
|
||||
public abstract boolean isOpen();
|
||||
public abstract SelectableChannel configureBlocking(boolean v)
|
||||
throws IOException;
|
||||
|
||||
public SelectionKey register(Selector selector, int interestOps,
|
||||
Object attachment)
|
||||
@ -29,6 +28,10 @@ public abstract class SelectableChannel implements Channel {
|
||||
return key;
|
||||
}
|
||||
|
||||
public boolean isOpen() {
|
||||
return key != null;
|
||||
}
|
||||
|
||||
public void close() throws IOException {
|
||||
if (key != null) {
|
||||
key.selector().remove(key);
|
||||
|
Reference in New Issue
Block a user