We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
while ((size = client.read(buf)) > 0) { buf.flip(); baos.write(buf.array(), 0, size); buf.clear(); }
在ReadEventHandler中,TCP可能粘包,此处baos存入的可能是多条消息的字节流,反序列化会导致客户端到达的部分消息丢失。(在ReadEventHandler中sleep一下就能看到此bug)
The text was updated successfully, but these errors were encountered:
是的,确实有这个问题。可以先写一个包的长度,再读取这个长度,看后面可以读的字节数有没有这么长,没有的话就全部放回,有的话再读出来
Sorry, something went wrong.
No branches or pull requests
在ReadEventHandler中,TCP可能粘包,此处baos存入的可能是多条消息的字节流,反序列化会导致客户端到达的部分消息丢失。(在ReadEventHandler中sleep一下就能看到此bug)
The text was updated successfully, but these errors were encountered: