* Added FIXME
* Fixed potential selection key leak
This commit is contained in:
parent
7cbd2a272e
commit
cd24a10d20
@ -176,6 +176,8 @@ class NioClientSocketPipelineSink extends AbstractChannelSink {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void register(NioSocketChannel channel) {
|
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);
|
boolean firstChannel = started.compareAndSet(false, true);
|
||||||
Selector selector;
|
Selector selector;
|
||||||
if (firstChannel) {
|
if (firstChannel) {
|
||||||
@ -312,6 +314,7 @@ class NioClientSocketPipelineSink extends AbstractChannelSink {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void close(SelectionKey k) {
|
private void close(SelectionKey k) {
|
||||||
|
k.cancel();
|
||||||
NioSocketChannel ch = (NioSocketChannel) k.attachment();
|
NioSocketChannel ch = (NioSocketChannel) k.attachment();
|
||||||
NioWorker.close(ch, ch.getSucceededFuture());
|
NioWorker.close(ch, ch.getSucceededFuture());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user