Why is InputStream.read() blocking here?

依然范特西╮ 提交于 2019-12-02 09:16:39

Your do/while loop runs until end of stream but the peer is never closing the socket. The protocol seems to require keeping the socket open for further commands, so you will have to adjust this part of it to include a length-word prefix so you know how many bytes to copy.

The question isn't about ByteArrayOutputStream not writing all your bytes, it is about blocking in is.read().

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