优化rpc返回

This commit is contained in:
duanhf2012
2020-03-31 19:56:06 +08:00
parent 9c9f72d559
commit b953d8dfbb
2 changed files with 12 additions and 6 deletions

View File

@@ -181,13 +181,16 @@ func (slf *Client) Run(){
}else {
delete(slf.pending,respone.Seq)
slf.pendingLock.Unlock()
err = processor.Unmarshal(respone.Returns,v.Reply)
if err != nil {
log.Error("rpcClient Unmarshal body error,error:%+v",err)
continue
//*****如果对方返回nil测试跨node时调用其他服务rpc不存在的情况
if len(respone.Returns) >0 {
err = processor.Unmarshal(respone.Returns,v.Reply)
if err != nil {
log.Error("rpcClient Unmarshal body error,error:%+v",err)
v.Err = err
}
}
if v.callback.IsValid() {
v.rpcHandler.(*RpcHandler).callResponeCallBack<-v
}else{