When I read the source code about grpc-go such as rsp, err := c.SayHello(context.Background(), &pb.HelloRequest{Name: name}) in grpc helloworld example. I know it use protobuf message to send request and receive response, and it also use protobuf transmit error message defined in status.proto file. But I can't understand how context transmit between client and server. I guess it also use pb message but I can't find where it's defined. Or it is transimit by http2 header frame?
0
votes
2 Answers
0
votes
It's not clear what do you mean by context transmission, because context.Context is just a Go object that has no methods for serialization / deserialization. Perhaps you're talking about GRPC metadata. As far as I remember, they use HTTP headers as a transport.