mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
fix regression in SocketSelector when selecting ServerSocketChannels
This commit is contained in:
parent
6fa25f992c
commit
fb40b046fd
@ -16,6 +16,8 @@ import java.nio.ByteBuffer;
|
||||
public abstract class SelectableChannel implements Channel {
|
||||
private SelectionKey key;
|
||||
|
||||
abstract int socketFD();
|
||||
|
||||
public abstract SelectableChannel configureBlocking(boolean v)
|
||||
throws IOException;
|
||||
|
||||
|
@ -23,6 +23,10 @@ public class ServerSocketChannel extends SelectableChannel {
|
||||
return new ServerSocketChannel();
|
||||
}
|
||||
|
||||
public int socketFD() {
|
||||
return channel.socketFD();
|
||||
}
|
||||
|
||||
public SelectableChannel configureBlocking(boolean v) throws IOException {
|
||||
return channel.configureBlocking(v);
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ class SocketSelector extends Selector {
|
||||
it.hasNext();)
|
||||
{
|
||||
SelectionKey key = it.next();
|
||||
SocketChannel c = (SocketChannel)key.channel();
|
||||
SelectableChannel c = key.channel();
|
||||
int socket = c.socketFD();
|
||||
if (c.isOpen()) {
|
||||
key.readyOps(0);
|
||||
@ -88,7 +88,7 @@ class SocketSelector extends Selector {
|
||||
|
||||
if (r > 0) {
|
||||
for (SelectionKey key : keys) {
|
||||
SocketChannel c = (SocketChannel)key.channel();
|
||||
SelectableChannel c = key.channel();
|
||||
int socket = c.socketFD();
|
||||
int ready = natUpdateReadySet(socket, key.interestOps(), state);
|
||||
key.readyOps(ready);
|
||||
|
Loading…
Reference in New Issue
Block a user