Netty代理示例中ctx.write(Unpooled.EMPTY_BUFFER)的用途是什么(What's the purpose of ctx.write(Unpooled.EMPTY_BUFFER) in Netty proxy example)
在Netty 代理示例的 HexDumpProxyBackendHandler中, channelActive方法的代码如下:
public void channelActive(ChannelHandlerContext ctx) { ctx.read(); ctx.write(Unpooled.EMPTY_BUFFER); }我的问题是ctx.write(Unpooled.EMPTY_BUFFER)的目的是什么? 在通道激活后是否需要发送空的TCP消息帧?
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); }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
更多推荐
发布评论