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

一个聊天程序设想 #1

Open
coneo opened this issue May 26, 2014 · 0 comments
Open

一个聊天程序设想 #1

coneo opened this issue May 26, 2014 · 0 comments
Labels

Comments

@coneo
Copy link
Owner

coneo commented May 26, 2014

分两个模块来考虑,一是client与srv保持连接,二是如何收发数据。

一:srv维持了所有客户端的连接信息flag(flag=0时会把client剔除)。client在每分钟的30秒时发送一个心跳包给srv,让相应的flag=1,srv在60秒的时候检查所有的client的flag,剔除掉那些flag==0的client。

二:每个客户端都维持了自己的聊天列表,当需要向其他client发送数据包时,只需按自己的连接列表中去发送,不经过服务器,减轻了服务器端的压力。

注意点: 1.当对方不在线时,此时应该由服务器保存数据包,当对方在线后,再推送给它(因此,应该有一个检查机制)

@coneo coneo changed the title 保持正交性 保持正交性11 May 26, 2014
@coneo coneo changed the title 保持正交性11 一个聊天程序设想 May 26, 2014
@coneo coneo added the design label May 3, 2015
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

1 participant