Fixed issue: NETTY-265 NIO datagram transport should not close the channel on write failure

This commit is contained in:
Trustin Lee 2009-12-22 04:38:34 +00:00
parent 974a18568a
commit c7e2562f1c

View File

@ -485,7 +485,7 @@ class NioDatagramWorker implements Runnable {
private static void writeNow(final NioDatagramChannel channel,
final int writeSpinCount) {
boolean open = true;
boolean addOpWrite = false;
boolean removeOpWrite = false;
@ -556,10 +556,6 @@ class NioDatagramWorker implements Runnable {
evt.getFuture().setFailure(t);
evt = null;
fireExceptionCaught(channel, t);
if (t instanceof IOException) {
open = false;
close(channel, succeededFuture(channel));
}
}
}
channel.inWriteNowLoop = false;
@ -567,14 +563,12 @@ class NioDatagramWorker implements Runnable {
fireWriteComplete(channel, writtenBytes);
if (open) {
if (addOpWrite) {
setOpWrite(channel);
} else if (removeOpWrite) {
clearOpWrite(channel);
}
}
}
private static void setOpWrite(final NioDatagramChannel channel) {
NioDatagramWorker worker = channel.worker;