3

netty 服务端推送sendBuf 满了后 一直阻塞 不会减少

 2 years ago
source link: https://ask.csdn.net/questions/7528487
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

netty 服务端推送sendBuf 满了后 一直阻塞 不会减少

netty 服务端向客户端推送大量数据,当服务端sendbuf 达到最高水位后(receivebuf空闲),不再继续推送数据,服务端sendbuf 却一直不下降,就卡在一个固定值了(64240),好像假死了,tcpdump 抓包 服务端能收到客户端的心跳数据,就是不能发送数据(服务netty channel iswriteble =false ,sendbuf 还是固定值)

查了下服务客户端的负载也在可接受的范围
netty 版本 4.1.66
服务端截图:

img

客户端截图:

img

下面是向客户端转发推送数据的代码片段:
@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {

img

img

img

img


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK