SocketChannel read() behaviour - short reads

橙三吉。 提交于 2019-12-02 09:27:18

Blocking mode means that it blocks until any data is received. It doesn't have to be an entire buffer full.

If you want to make sure you've received an entire bufferful of data, you should read() in a loop until you've filled up your buffer.

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