Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Netty 抽象对象通道中的无限循环_Netty - Fatal编程技术网

Netty 抽象对象通道中的无限循环

Netty 抽象对象通道中的无限循环,netty,Netty,我不确定AbstractOioByteChannel.doWrite(ChannelOutboundBuffer in)中的无限循环是否正确,netty版本4.0.9 谢谢 -Igor如果没有收到消息,您需要添加一个循环中断(以下粗体) *for (;;) { Object msg = in.current(); **if (msg == null) { break; }** if (msg inst

我不确定AbstractOioByteChannel.doWrite(ChannelOutboundBuffer in)中的无限循环是否正确,netty版本4.0.9 谢谢
-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)));
        }
    }*

为什么你认为这不好?