Open lee123456780 opened 3 years ago
MY CODE LIKE THIS
conn, err := grpc.Dial("localhost:1234", grpc.WithInsecure()) if err != nil { log.Fatal(err) } defer conn.Close() ct := go_protoc.NewGreeterClient(conn) re, err1 := ct.SayHello(context.Background(), &go_protoc.HelloRequest{ Name: "hello word", }) fmt.Println(re) if err1 != nil { log.Fatal(err1) }
BUT I GOT AN ERROR :
rpc error: code = Unavailable desc = timed out waiting for server handshake
WHAT'S WRONG?
As per README, you'll have to match with writers.
grpcl := m.MatchWithWriters(cmux.HTTP2MatchHeaderFieldSendSettings("content-type", "application/grpc"))
can you give me a client demo code for gRPC ? ths