From 4be0e7428d537cf41dd2f9733a4e1a377e216c16 Mon Sep 17 00:00:00 2001 From: boyce Date: Mon, 21 Dec 2020 15:04:32 +0800 Subject: [PATCH] =?UTF-8?q?Rpc=E5=86=85=E5=AD=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rpc/rpchandler.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/rpc/rpchandler.go b/rpc/rpchandler.go index c99e791..3106f15 100644 --- a/rpc/rpchandler.go +++ b/rpc/rpchandler.go @@ -49,6 +49,7 @@ type RpcHandler struct { callRequest chan *RpcRequest rpcHandler IRpcHandler mapFunctions map[string]RpcMethodInfo + mapRawFunctions map[int] funcRpcClient FuncRpcClient funcRpcServer FuncRpcServer @@ -257,9 +258,7 @@ func (handler *RpcHandler) HandlerRpcRequest(request *RpcRequest) { var err error var iParam interface{} //单协程或非异步调用时直接使用预置对象 - if handler.IsSingleCoroutine() && v.hasResponder==false { - iParam = v.inParam - }else if v.inParam != nil { + if v.inParam!= nil { iParam = reflect.New(v.inParamValue.Type().Elem()).Interface() } @@ -311,8 +310,6 @@ func (handler *RpcHandler) HandlerRpcRequest(request *RpcRequest) { if v.outParamValue.IsValid() { if request.localReply!=nil { oParam = reflect.ValueOf(request.localReply) //输出参数 - }else if handler.IsSingleCoroutine()==true{ - oParam = v.outParamValue }else{ oParam = reflect.New(v.outParamValue.Type().Elem()) }