Netty 抽象对象通道中的无限循环
我不确定AbstractOioByteChannel.doWrite(ChannelOutboundBuffer in)中的无限循环是否正确,netty版本4.0.9 谢谢Netty 抽象对象通道中的无限循环,netty,Netty,我不确定AbstractOioByteChannel.doWrite(ChannelOutboundBuffer in)中的无限循环是否正确,netty版本4.0.9 谢谢 -Igor如果没有收到消息,您需要添加一个循环中断(以下粗体) *for (;;) { Object msg = in.current(); **if (msg == null) { break; }** if (msg inst
-Igor如果没有收到消息,您需要添加一个循环中断(以下粗体)
*for (;;) {
Object msg = in.current();
**if (msg == null) {
break;
}**
if (msg instanceof ByteBuf) {
....
} else if (msg instanceof FileRegion) {
...
} else {
in.remove(new UnsupportedOperationException(
"unsupported message type: " + StringUtil.simpleClassName(msg)));
}
}*
为什么你认为这不好?