ing
This commit is contained in:
parent
fe3407551c
commit
ec8c352d5f
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user