在Netty 3中,我们可以执行以下操作:
Channel.setReadable(false);
Channel.setReadable(true);
我已阅读:http : //netty.io/news/2012/09/13/4-0-0-alpha4.html
但是对于最新的Netty 4版本(4.0.17,http ://netty.io/news/2014/02/25/4-0-17-Final.html ),此代码无效,因为没有ChannelHandlerContext#readable
:
serverChannel.pipeline().firstContext().readable(false);
serverChannel.pipeline().firstContext().readable(true);
用于暂停:
channel.config.setAutoRead(false)
并恢复:
channel.config.setAutoRead(true)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句