Toggle navigation
Toggle navigation
This project
Loading...
Sign in
liuming
/
developer-docs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
echo
2016-04-09 14:52:19 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f1124cb5638502068e51aff4b2696701826deb03
f1124cb5
1 parent
da44fcdb
Updated 关于用户掉线的处理机制 (markdown)
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
关于用户掉线的处理机制.md
关于用户掉线的处理机制.md
View file @
f1124cb
...
...
@@ -3,7 +3,11 @@
### 消息断线的检测
采用客户端向公共群发心跳消息的方式,不用服务器端维持。
*
具体为每隔10(暂定)秒发送一条自定义消息{"heartbeat":"alive", from:"7"}
*
具体为每隔10(暂定)秒发送一条自定义消息
```
{
"type"
:
"heartbeat"
,
"from"
:
"7"
(用户Id)
}
```
*
接收方设定对方的生存时间为30秒(暂定),开始倒计时,
*
倒计时一旦结束,则认为对方处于offline的状态,或者本方的网络出了问题,给予提示。
*
每收到一次心跳或者一次来自对方的消息,则把对方生存时长重置为30秒,重新启动倒计时。
...
...
Please
register
or
login
to post a comment