File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
examples/features/stream/client Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ func clientStream(ctx context.Context, proxy pb.TestStreamClientProxy) error {
86
86
// Call Send to continuously send data.
87
87
if err = streamClient .Send (& pb.HelloReq {Msg : fmt .Sprintf ("ping : %v" , i )}); err != nil {
88
88
log .ErrorContextf (ctx , "ClientStream send error: %v" , err )
89
- break
89
+ return err
90
90
}
91
91
}
92
92
@@ -134,7 +134,7 @@ func bidirectionalStream(ctx context.Context, proxy pb.TestStreamClientProxy) er
134
134
// The client send request data to the server 5 times using a for loop.
135
135
if err = streamClient .Send (& pb.HelloReq {Msg : "ping: " + strconv .Itoa (i )}); err != nil {
136
136
log .ErrorContextf (ctx , "BidirectionalStream Send message error: %v" , err )
137
- break
137
+ return err
138
138
}
139
139
}
140
140
@@ -153,6 +153,7 @@ func bidirectionalStream(ctx context.Context, proxy pb.TestStreamClientProxy) er
153
153
}
154
154
if err != nil {
155
155
log .ErrorContextf (ctx , "BidirectionalStream receive error from server: %v" , err )
156
+ break
156
157
}
157
158
log .InfoContextf (ctx , "BidirectionalStream reply message is: %s" , rsp .GetMsg ())
158
159
}
You can’t perform that action at this time.
0 commit comments