本文介绍了Netty 代理示例中 ctx.write(Unpooled.EMPTY_BUFFER) 的目的是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 Netty 的 HexDumpProxyBackendHandler
中 代理示例,channelActive
方法代码如下:
In HexDumpProxyBackendHandler
of Netty proxy example , the code of the method channelActive
likes following:
public void channelActive(ChannelHandlerContext ctx) {
ctx.read();
ctx.write(Unpooled.EMPTY_BUFFER);
}
我的问题是 ctx.write(Unpooled.EMPTY_BUFFER)
的目的是什么?通道激活后是否需要发送一个空的TCP消息帧?
My question is what's the purpose of ctx.write(Unpooled.EMPTY_BUFFER)
? Is it necessary to send an empty TCP message frame after the channel active?
推荐答案
没有理由,这很可能是错过了删除.我将清理示例以将其删除.感谢您告诉我们
There is not reason and this was most likely missed to be removed. I will clean up the example to remove it. Thanks for let us know
这篇关于Netty 代理示例中 ctx.write(Unpooled.EMPTY_BUFFER) 的目的是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!