Reduced unnecessary system calls triggered by Channel.isConnected()

This commit is contained in:
Trustin Lee 2009-09-21 02:08:19 +00:00
parent 588cfa8518
commit 80b6a5b7ae

View File

@ -342,11 +342,6 @@ class NioWorker implements Runnable {
}
static void write(final NioSocketChannel channel, boolean mightNeedWakeup) {
if (!channel.isConnected()) {
cleanUpWriteBuffer(channel);
return;
}
if (mightNeedWakeup && scheduleWriteIfNecessary(channel)) {
return;
}
@ -452,7 +447,9 @@ class NioWorker implements Runnable {
addOpWrite = true;
break;
}
} catch (AsynchronousCloseException e) {
} catch (ClosedChannelException e) {
cleanUpWriteBuffer(channel);
// Doesn't need a user attention - ignore.
channel.currentWriteEvent = evt;
channel.currentWriteIndex = bufIdx;