* Added FIXME

* Fixed potential selection key leak
This commit is contained in:
Trustin Lee 2008-12-08 15:17:59 +00:00
parent 7cbd2a272e
commit cd24a10d20

View File

@ -176,6 +176,8 @@ class NioClientSocketPipelineSink extends AbstractChannelSink {
}
void register(NioSocketChannel channel) {
// FIXME: Infinite loop on selector creation failure.
// Apply the same fix with what's applied in NioWorker.register()
boolean firstChannel = started.compareAndSet(false, true);
Selector selector;
if (firstChannel) {
@ -312,6 +314,7 @@ class NioClientSocketPipelineSink extends AbstractChannelSink {
}
private void close(SelectionKey k) {
k.cancel();
NioSocketChannel ch = (NioSocketChannel) k.attachment();
NioWorker.close(ch, ch.getSucceededFuture());
}