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

全局消息数量限制的问题 #4

Closed
lzsong opened this issue Feb 23, 2020 · 2 comments
Closed

全局消息数量限制的问题 #4

lzsong opened this issue Feb 23, 2020 · 2 comments

Comments

@lzsong
Copy link

lzsong commented Feb 23, 2020

全局消息是用65535的数组来做一个环形的缓存队列,但是gmsgId一直都是++,在用完65535的时候是不是得重置为0从头开始,包括取消息(r *msgQue) getGMsg中r.gmsgId++也是。
在wsserver测试实例中调整这个数组为var gmsgArray = [10]*gMsg{},全局聊天10个消息后就会异常了。

@magiclvzs
Copy link
Owner

我并不想解释无符号溢出后会从0开始这件事

1 similar comment
@magiclvzs
Copy link
Owner

我并不想解释无符号溢出后会从0开始这件事

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants