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

Open
ryangopher opened this issue Sep 12, 2017 · 4 comments
Open

心跳包校验不过 #4

ryangopher opened this issue Sep 12, 2017 · 4 comments

Comments

@ryangopher
Copy link

ryangopher commented Sep 12, 2017

你心跳包校验是0x32,我校验的是0x16,从00开始到03结束

@HengCC
Copy link

HengCC commented Oct 12, 2017

确实不通过好像. 我的结果 "校验码校验失败,数据校验码为:50, 待校验的校验码为:22, "

十进制的

@ryangopher
Copy link
Author

ryangopher commented Oct 12, 2017

我上面列出来的数字都是十六进制的,那咱俩的校验一样

@HengCC
Copy link

HengCC commented Oct 12, 2017

@Dufresh HI, 我换了个心跳包可以校验了. 现在卡在分包的处理上. 如何重新把这些包拼起来呢. 或者要求终端重传, 不知道有什么好的方案. 你有什么建议吗?

@ryangopher
Copy link
Author

@HengCC 不好意思,没有注意到,我这边分包处理是先放到一个缓冲区域(假设n个字节),然后校验最有一个字符,如果是0xfd就把n-1个字节取出来转义到一个转义缓存中,后续的解析处理都是直接从转义缓存中取出来的,解析时候需要判断是否一个完整包,不是的话继续读取网络数据,重复上面流程

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