diff --git a/client/client.go b/client/client.go index 848a7f8..ca391da 100644 --- a/client/client.go +++ b/client/client.go @@ -82,19 +82,9 @@ func (c *Client) logHeader() string { } func (c *Client) Send(method string, params ...interface{}) error { - rs, err := c.internalSend(false, nil, method, params...) - if nil != err { - return err - } + _, err := c.internalSend(false, nil, method, params...) - defer releaseRequestState(rs) - select { - case <-rs.doneChan: - if nil != rs.clientError { - return rs.clientError - } - } - return nil + return err } func (c *Client) Call(result interface{}, method string, params ...interface{}) error { @@ -133,10 +123,10 @@ func (c *Client) internalSend(hasResponse bool, result interface{}, method strin rs.method = method rs.params = params - rs.doneChan = make(chan *requestState, 1) if hasResponse { rs.id = c.getRequestID() rs.result = result + rs.doneChan = make(chan *requestState, 1) } select {