netty http客户端每次响应后关闭

时间:2018-06-25 09:40:57

标签: netty

客户端有入站处理程序,我在其中放了一个ctx.close,但是客户端从服务器获得响应后,它无法关闭连接?

@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
            log.info("receive: {}", msg);
            // processes message.
            ctx.close();
}

我认为服务器中的套接字仍处于打开状态是因为使用 netstat -ano | grep server_port | wc 每个客户请求的行号都会增加1。

0 个答案:

没有答案
相关问题