client sends multiple roundtrips

This commit is contained in:
Stephen McQuay 2018-01-21 20:12:05 -08:00
parent 70288014ea
commit f61632af7f
Signed by: sm
GPG Key ID: 4E4B72F479BA3CE5

View File

@ -20,10 +20,12 @@ func main() {
c := pb.NewHelloWorldProtobufClient(fmt.Sprintf("http://%s", os.Args[1]), &http.Client{})
resp, err := c.Hello(context.Background(), &pb.HelloReq{Subject: strings.Join(os.Args[2:], " ")})
if err != nil {
fmt.Fprintf(os.Stderr, "hello: %v\n", err)
os.Exit(1)
for i := 0; ; i++ {
resp, err := c.Hello(context.Background(), &pb.HelloReq{Subject: strings.Join(os.Args[2:], " ")})
if err != nil {
fmt.Fprintf(os.Stderr, "hello: %#v\n", err)
os.Exit(1)
}
fmt.Printf("0x%08x: %#v\n", i, resp)
}
fmt.Printf("%v\n", resp)
}