Netty write several messages through one channel

2019-08-15 06:28发布

I'm newbie in Netty. I want send several messages through one channel in this way

channel.writeAndFlush(Unpooled.copiedBuffer("TBD", CharsetUtil.UTF_8)).sync()
channel.writeAndFlush(Unpooled.copiedBuffer("TBD1", CharsetUtil.UTF_8)).sync()

But this code produce java.nio.channels.ClosedChannelException. How to do it correctly?

1条回答
我只想做你的唯一
2楼-- · 2019-08-15 07:13

This means the Channel was closed before. You should investigate the cause for this.

查看更多
登录 后发表回答