Client channel is not in writable state(NIO) Netty

ぐ巨炮叔叔 提交于 2019-12-05 18:46:27

Superficially, it is because the ChannelBuffer is full, i.e. no more writable bytes.

It could be caused by writing too fast, or the channel is not able to send out any bytes. If you're not writing anything too fast, perhaps it's because the channel never successfully sent out the bytes written.

You should be using the selector, or whatever Netty gives you around it, to tell you when the channel is writable. You certainly shouldn't be literally wasting time by sleeping in a loop. The channel state can't change while you're doing that. It is only changed by select().

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!