gpt4 book ai didi

netty - 如何使用 Netty 4 暂停和恢复阅读?

转载 作者:行者123 更新时间:2023-12-05 00:26:30 25 4
gpt4 key购买 nike

在 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)

关于netty - 如何使用 Netty 4 暂停和恢复阅读?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22060454/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com