Change a few things

This commit is contained in:
Asim Aslam
2019-01-10 11:39:39 +00:00
parent bb31480f1a
commit 648da5494f
5 changed files with 97 additions and 38 deletions

View File

@@ -97,7 +97,7 @@ func (r *rpcClient) call(ctx context.Context, address string, req Request, resp
request: req,
closed: make(chan bool),
codec: newRpcCodec(msg, c, cf),
seq: fmt.Sprintf("%v", seq),
id: fmt.Sprintf("%v", seq),
}
defer stream.Close()
@@ -111,7 +111,7 @@ func (r *rpcClient) call(ctx context.Context, address string, req Request, resp
}()
// send request
if err := stream.Send(req.Request()); err != nil {
if err := stream.Send(req.Body()); err != nil {
ch <- err
return
}
@@ -183,7 +183,7 @@ func (r *rpcClient) stream(ctx context.Context, address string, req Request, opt
ch := make(chan error, 1)
go func() {
ch <- stream.Send(req.Request())
ch <- stream.Send(req.Body())
}()
var grr error