Fixed indefinite blocking

This commit is contained in:
Trustin Lee 2009-07-08 11:44:36 +00:00
parent 31ec36f3bb
commit 580a6e491a

View File

@ -227,13 +227,14 @@ class NioServerSocketPipelineSink extends AbstractChannelSink {
try { try {
if (selector.select(1000) > 0) { if (selector.select(1000) > 0) {
selector.selectedKeys().clear(); selector.selectedKeys().clear();
for (;;) { }
SocketChannel acceptedSocket = channel.socket.accept();
if (acceptedSocket != null) { for (;;) {
registerAcceptedChannel(acceptedSocket); SocketChannel acceptedSocket = channel.socket.accept();
} else { if (acceptedSocket != null) {
break; registerAcceptedChannel(acceptedSocket);
} } else {
break;
} }
} }
} catch (SocketTimeoutException e) { } catch (SocketTimeoutException e) {