File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ var DefaultOption = &Option{
183
183
}
184
184
```
185
185
186
- 一般来说,涉及协议协商的这部分信息,需要设计固定的字节来传输的。但是为了实现上更简单,GeeRPC 客户端固定采用 JSON 编码 Option,后续的 header 和 body 的编码方式由 Option 中的 CodeType 指定,服务端首先使用 JSON 解码 Option,然后通过 Option 得 CodeType 解码剩余的内容。即报文将以这样的形式发送:
186
+ 一般来说,涉及协议协商的这部分信息,需要设计固定的字节来传输的。但是为了实现上更简单,GeeRPC 客户端固定采用 JSON 编码 Option,后续的 header 和 body 的编码方式由 Option 中的 CodeType 指定,服务端首先使用 JSON 解码 Option,然后通过 Option 的 CodeType 解码剩余的内容。即报文将以这样的形式发送:
187
187
188
188
``` bash
189
189
| Option{MagicNumber: xxx, CodecType: xxx} | Header{ServiceMethod ...} | Body interface{} |
@@ -439,4 +439,4 @@ reply: geerpc resp 4
439
439
## 附 推荐阅读
440
440
441
441
- [ Go 语言简明教程] ( https://geektutu.com/post/quick-golang.html )
442
- - [ Go 语言笔试面试题] ( https://geektutu.com/post/qa-golang.html )
442
+ - [ Go 语言笔试面试题] ( https://geektutu.com/post/qa-golang.html )
You can’t perform that action at this time.
0 commit comments