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

message seq problem #8

Closed
morya opened this issue Aug 1, 2016 · 2 comments
Closed

message seq problem #8

morya opened this issue Aug 1, 2016 · 2 comments

Comments

@morya
Copy link

morya commented Aug 1, 2016

message seq is inited in the below function, it's not global variable, and I don't see any function loading this one, so, when one client is offline and online again, the seq will always begin from 0?

func (client *Client) Write() {

我在上面的函数里面看到有初始化seq的地方,但没有看到任何地方对它进行持久化,那么,客户端再次连接进来之后,seq岂不是依然从0开始?

看文档不是这么说的,文档说客户端连接后,可以从某个seq位置来取消息,类似于断点续传?

@richmonkey
Copy link
Contributor

这个seq支持用户ack时的标识,所以只要单个链接唯一就好了。
消息的持久化以及离线消息的获取使用EMessage结构里面的msgid去判别的,同时每个用户接受到的最后一条消息的id是存储在storage server里面的

@morya
Copy link
Author

morya commented Aug 2, 2016

谢谢,感觉工程使用makefile来区分不同的模块,所有文件都放置在一个目录,有些混乱。
建议类似于nsq的internal文件夹或者codis-proxy的 pkg/xx 方式组织。

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