Fix broken UDP support. This got broken in 3.4.0.Alpha1
This commit is contained in:
parent
0334267b51
commit
f1f92c0290
@ -431,9 +431,8 @@ abstract class AbstractNioWorker implements Worker {
|
||||
}
|
||||
|
||||
protected abstract boolean scheduleWriteIfNecessary(final AbstractNioChannel<?> channel);
|
||||
|
||||
|
||||
private void write0(AbstractNioChannel<?> channel) {
|
||||
protected void write0(AbstractNioChannel<?> channel) {
|
||||
boolean open = true;
|
||||
boolean addOpWrite = false;
|
||||
boolean removeOpWrite = false;
|
||||
@ -638,7 +637,7 @@ abstract class AbstractNioWorker implements Worker {
|
||||
}
|
||||
}
|
||||
|
||||
private void cleanUpWriteBuffer(AbstractNioChannel<?> channel) {
|
||||
protected void cleanUpWriteBuffer(AbstractNioChannel<?> channel) {
|
||||
Exception cause = null;
|
||||
boolean fireExceptionCaught = false;
|
||||
|
||||
|
@ -206,5 +206,34 @@ public class NioDatagramWorker extends AbstractNioWorker {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeFromUserCode(final AbstractNioChannel<?> channel) {
|
||||
/*
|
||||
* Note that we are not checking if the channel is connected. Connected
|
||||
* has a different meaning in UDP and means that the channels socket is
|
||||
* configured to only send and receive from a given remote peer.
|
||||
*/
|
||||
if (!channel.isBound()) {
|
||||
cleanUpWriteBuffer(channel);
|
||||
return;
|
||||
}
|
||||
|
||||
if (scheduleWriteIfNecessary(channel)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// From here, we are sure Thread.currentThread() == workerThread.
|
||||
|
||||
if (channel.writeSuspended) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (channel.inWriteNowLoop) {
|
||||
return;
|
||||
}
|
||||
|
||||
write0(channel);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user