Name Date Size #Lines LOC

..--

BUILDH A D25-Apr-20251.2 KiB4844

README.cn.mdH A D25-Apr-20251,009 3718

README.en.mdH A D25-Apr-20251 KiB3819

alts_client.pyH A D25-Apr-20251.3 KiB4220

alts_server.pyH A D25-Apr-20251.2 KiB4118

client.pyH A D25-Apr-20254.7 KiB14079

demo.protoH A D25-Apr-20253.1 KiB7059

demo_pb2.pyH A D25-Apr-20251.5 KiB3017

demo_pb2.pyiH A D25-Apr-2025841 2218

demo_pb2_grpc.pyH A D25-Apr-20258.2 KiB187165

server.pyH A D25-Apr-20254.5 KiB12870

README.cn.md

1## Data transmission demo for using gRPC in Python
2
3在Python中使用gRPC时, 进行数据传输的四种方式  [官方指南](<https://grpc.io/docs/guides/concepts/#unary-rpc>)
4
5- #### 一元模式
6
7  在一次调用中, 客户端只能向服务器传输一次请求数据, 服务器也只能返回一次响应
8
9  `client.py: simple_method`
10
11  `server.py: SimpleMethod`
12
13- #### 客户端流模式
14
15  在一次调用中, 客户端可以多次向服务器传输数据, 但是服务器只能返回一次响应
16
17  `client.py: client_streaming_method `
18
19  `server.py: ClientStreamingMethod`
20
21- #### 服务端流模式
22
23  在一次调用中, 客户端只能向服务器传输一次请求数据, 但是服务器可以多次返回响应
24
25  `client.py: server_streaming_method`
26
27  `server.py: ServerStreamingMethod`
28
29- #### 双向流模式
30
31  在一次调用中, 客户端和服务器都可以向对方多次收发数据
32
33  `client.py: bidirectional_streaming_method`
34
35  `server.py: BidirectionalStreamingMethod`
36
37

README.en.md

1##  Data transmission demo for using gRPC in Python
2
3Four ways of data transmission when gRPC is used in Python.  [Official Guide](<https://grpc.io/docs/guides/concepts/#unary-rpc>)
4
5- #### unary-unary
6
7  In a single call, the client can only send request once, and the server can only respond once.
8
9  `client.py: simple_method`
10
11  `server.py: SimpleMethod`
12
13- #### stream-unary
14
15  In a single call, the client can transfer data to the server an arbitrary number of times, but the server can only return a response once.
16
17  `client.py: client_streaming_method`
18
19  `server.py: ClientStreamingMethod`
20
21- #### unary-stream
22
23  In a single call, the client can only transmit data to the server at one time, but the server can return the response many times.
24
25  `client.py: server_streaming_method`
26
27  `server.py: ServerStreamingMethod`
28
29- #### stream-stream
30
31  In a single call, both client and server can send and receive data
32  to each other multiple times.
33
34  `client.py: bidirectional_streaming_method`
35
36  `server.py: BidirectionalStreamingMethod`
37
38