https://github.com/dreamlike-ocean/im
使用Vertx和Netty基于TCP协议编写的即时通讯服务端,使用语言为kotlin
https://github.com/dreamlike-ocean/im
Last synced: about 2 months ago
JSON representation
使用Vertx和Netty基于TCP协议编写的即时通讯服务端,使用语言为kotlin
- Host: GitHub
- URL: https://github.com/dreamlike-ocean/im
- Owner: dreamlike-ocean
- Created: 2022-02-11T12:08:23.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-12T17:29:59.000Z (over 3 years ago)
- Last Synced: 2025-02-12T15:51:52.230Z (4 months ago)
- Language: Kotlin
- Homepage:
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
##handler配置
AllDecoder -> AuthenticateHandler,MessageHeaderHandler(理论平级但是AuthenticateHandler在前)
AuthenticateHandler验证之后会将自己从pipeline中移除
AuthenticateHandler和其余Request
## 协议格式由header+body构成
#### header格式
##### 用户发给server:
前四位(int)type
再四位(int)sequenceId 如果不是type不是请求则为-1
后四位(int)payLoadLength
##### server发给用户
前四位(int)type
再四位(int)sequenceId 如果不是type不是请求则为-1
后四位(int)payLoadLength
最后为(int)senderId
#### request的body格式
json结构必须存在requestType用于指示当前请求的目的pullUnread -> 拉取未读信息,响应中json的message为此次结果
pullRecord -> 拉取与某人所有的记录 必须包括number类型的receiver字段响应中,json的message为此次结果
#### 其余的body格式
[id1,id2,id3,id4 {text}] 文本[id1,id2,id3&filename fileBuffer] 文件