Skip to content

Commit

Permalink
Merge branch 'main' into optimize-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
li-jin-gou authored Oct 12, 2023
2 parents 605f7bf + cb4a92a commit 20a988a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

# CloudWeGo

The [cloudwego.io](https://www.cloudwego.io/) site is built with [Hugo](https://gohugo.io/) and hosted on [Vercel](https://vercel.com/?utm_source=CloudWeGo&utm_campaign=oss).
The CloudWeGo site is currently built with [Hugo](https://gohugo.io/).

For CN users, please visit : [cloudwego.cn](https://www.cloudwego.cn/zh) ;
For Non-CN users, please visit: [cloudwego.io](https://www.cloudwego.io/)

## Prerequisites

Expand Down Expand Up @@ -39,6 +42,6 @@ This project is overridden from [docsy](http://github.com/google/docsy), and we'

## Credits

The website is deployed on [Vercel](https://vercel.com/?utm_source=CloudWeGo&utm_campaign=oss).
The [cloudwego.io](https://www.cloudwego.io/) website is deployed on [Vercel](https://vercel.com/?utm_source=CloudWeGo&utm_campaign=oss).

![Vercel](https://images.ctfassets.net/e5382hct74si/78Olo8EZRdUlcDUFQvnzG7/fa4cdb6dc04c40fceac194134788a0e2/1618983297-powered-by-vercel.svg)
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,11 @@ For enabling Framed: prepend a 4-byte (int32) length to indicate the size of thr
client.WithTransportProtocol(transport.Framed)
```
Note:
1. It's not necessary, but without it, the server side may not be able to decode with frugal (refer to: "Kitex Server -> Notes");
1. If Framed is not set, there may be issues:
1. The server may not be able to decode with frugal without Payload Size (refer to: "Kitex Server -> Notes");
2. The server won't reply with a `Framed` payload, thus the Client may also not be able to decode with frugal (no Payload Size again);
2. If the target server does not support `Framed`, then don't use it; the client can encode without it, but if the response (from the server) is not Framed (i.e. with preprended payload size), the client may not be able to decode with Frugal (so in this case, do not use slim template);
3. `TTHeaderFramed` is an alternative.
3. `TTHeaderFramed` is an alternative (it's the BIT-OR result of `TTHeader | Framed`).

##### Example Code

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,11 @@ client.WithTransportProtocol(transport.Framed)
```

注:
1. 非必须;如不指定 Framed,Server 端可能无法用 frugal 解码(详见 "Kitex Server -> 注意事项");
1. 如不指定 Framed,可能存在如下问题:
1. Server 端可能无法用 frugal 解码(因为读不到 Payload Size,详见 "Kitex Server -> 注意事项");
2. Server 端不会返回 Framed Payload,Client 可能无法用 frugal 解码(因为读不到 Payload Size);
2. 如果目标 Server 不支持 Framed,则不应指定。不影响 Client 侧使用 frugal 编码;但 Server 回包如不是 Framed,Client 可能无法用 frugal 解码(这种情况慎用 slim 模板);
3. 也可使用 TTHeaderFramed。
3. 也可使用 TTHeaderFramed(即 `TTHeader | Framed` 位与结果)

##### 示例代码

Expand Down

0 comments on commit 20a988a

Please sign in to comment.