Skip to content
New issue

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

发送9000个字节的消息会接收失败 #17

Open
tidus5 opened this issue Jul 28, 2018 · 2 comments
Open

发送9000个字节的消息会接收失败 #17

tidus5 opened this issue Jul 28, 2018 · 2 comments
Labels

Comments

@tidus5
Copy link
Contributor

tidus5 commented Jul 28, 2018

客户端建立连接后,发送
ByteBuf bb = Unpooled.buffer(128);
int N = 9000;
for (int i = N; i > 0; i-=4) {
bb.writeInt(i);
}
tc.send(bb);

调试发现 server 的 Kcp.java 的 peekSize 总是走到
if (rcv_queue.size() < seq.frg + 1)
{
return -1;
}

@tidus5
Copy link
Contributor Author

tidus5 commented Jul 31, 2018

大概找到原因了,首先是默认的Netty 设置,缓冲区不够长,导致发送9000多字节后可能出现丢失。
然后KcpOnUdp.java 的update() 方法,时间戳转换为 int, 导致变成负数。
所以,超时补发也失效了。

希望作者修复这里 时间转为int的bug

@beykery
Copy link
Owner

beykery commented Sep 22, 2018

@tidus5 已经把你的pr合并了。

@beykery beykery added the bug label Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants