Reduced unnecessary system calls triggered by Channel.isConnected()
This commit is contained in:
parent
588cfa8518
commit
80b6a5b7ae
@ -342,11 +342,6 @@ class NioWorker implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void write(final NioSocketChannel channel, boolean mightNeedWakeup) {
|
static void write(final NioSocketChannel channel, boolean mightNeedWakeup) {
|
||||||
if (!channel.isConnected()) {
|
|
||||||
cleanUpWriteBuffer(channel);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mightNeedWakeup && scheduleWriteIfNecessary(channel)) {
|
if (mightNeedWakeup && scheduleWriteIfNecessary(channel)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -452,7 +447,9 @@ class NioWorker implements Runnable {
|
|||||||
addOpWrite = true;
|
addOpWrite = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (AsynchronousCloseException e) {
|
} catch (ClosedChannelException e) {
|
||||||
|
cleanUpWriteBuffer(channel);
|
||||||
|
|
||||||
// Doesn't need a user attention - ignore.
|
// Doesn't need a user attention - ignore.
|
||||||
channel.currentWriteEvent = evt;
|
channel.currentWriteEvent = evt;
|
||||||
channel.currentWriteIndex = bufIdx;
|
channel.currentWriteIndex = bufIdx;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user