(client ecpb.EchoClient, message string)
| 37 | var addr = flag.String("addr", "localhost:50051", "the address to connect to") |
| 38 | |
| 39 | func callUnaryEcho(client ecpb.EchoClient, message string) { |
| 40 | ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) |
| 41 | defer cancel() |
| 42 | resp, err := client.UnaryEcho(ctx, &ecpb.EchoRequest{Message: message}) |
| 43 | if err != nil { |
| 44 | log.Fatalf("client.UnaryEcho(_) = _, %v: ", err) |
| 45 | } |
| 46 | fmt.Println("UnaryEcho: ", resp.Message) |
| 47 | } |
| 48 | |
| 49 | func main() { |
| 50 | flag.Parse() |