From f61632af7fb74c062f0abcc6201a84230c670f62 Mon Sep 17 00:00:00 2001 From: stephen mcquay Date: Sun, 21 Jan 2018 20:12:05 -0800 Subject: [PATCH] client sends multiple roundtrips --- cmd/hwtc/main.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cmd/hwtc/main.go b/cmd/hwtc/main.go index d1b397a..ee80b92 100644 --- a/cmd/hwtc/main.go +++ b/cmd/hwtc/main.go @@ -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) }