update protocol

This commit is contained in:
Cam 2022-01-08 12:50:03 +08:00
parent aaee2de166
commit b75335c306

View File

@ -3,14 +3,14 @@
## 包格式
```txt
___________________________________________________________________________
| | | | | |
| sequence_id | operation | protocol_version | header_size | package_size |
|_____________|___________|__________________|_____________|______________|
| |
| data |
| |
|_________________________________________________________________________|
____________________________________________________________________________
| | | | | |
| package_size | header_size | protocol_version | operation | sequence_id |
|______________|_____________|__________________|____________|_____________|
| |
| data |
| |
|__________________________________________________________________________|
```
包为 byte 数据,由头部和数据组成,字节序均为大端模式
@ -19,7 +19,7 @@ ___________________________________________________________________________
| 偏移量 | 长度 | 含义 |
| ------ | ---- | ------------------------- |
| 0 | f | 包总大小 package_size |
| 0 | 4 | 包总大小 package_size |
| 4 | 2 | 头部大小 header_size |
| 6 | 2 | 协议版本 protocol_version |
| 8 | 4 | 操作码 operation |