Fixed an infinite loop on a certain NIO impl

This commit is contained in:
Trustin Lee 2011-03-25 02:27:20 +09:00
parent 77f79c3ea6
commit 370160d0a5
3 changed files with 3 additions and 0 deletions

View File

@ -388,6 +388,7 @@ class NioClientSocketPipelineSink extends AbstractChannelSink {
} catch (Throwable t) {
ch.connectFuture.setFailure(t);
fireExceptionCaught(ch, t);
k.cancel(); // Some JDK implementations run into an infinite loop without this.
ch.worker.close(ch, succeededFuture(ch));
}
}

View File

@ -422,6 +422,7 @@ class NioDatagramWorker implements Runnable {
}
if (failure) {
key.cancel(); // Some JDK implementations run into an infinite loop without this.
close(channel, succeededFuture(channel));
return false;
}

View File

@ -352,6 +352,7 @@ class NioWorker implements Runnable {
}
if (ret < 0 || failure) {
k.cancel(); // Some JDK implementations run into an infinite loop without this.
close(channel, succeededFuture(channel));
return false;
}