Fixed indefinite blocking
This commit is contained in:
parent
31ec36f3bb
commit
580a6e491a
@ -227,6 +227,8 @@ class NioServerSocketPipelineSink extends AbstractChannelSink {
|
|||||||
try {
|
try {
|
||||||
if (selector.select(1000) > 0) {
|
if (selector.select(1000) > 0) {
|
||||||
selector.selectedKeys().clear();
|
selector.selectedKeys().clear();
|
||||||
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
SocketChannel acceptedSocket = channel.socket.accept();
|
SocketChannel acceptedSocket = channel.socket.accept();
|
||||||
if (acceptedSocket != null) {
|
if (acceptedSocket != null) {
|
||||||
@ -235,7 +237,6 @@ class NioServerSocketPipelineSink extends AbstractChannelSink {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} catch (SocketTimeoutException e) {
|
} catch (SocketTimeoutException e) {
|
||||||
// Thrown every second to get ClosedChannelException
|
// Thrown every second to get ClosedChannelException
|
||||||
// raised.
|
// raised.
|
||||||
|
Loading…
Reference in New Issue
Block a user