优化原始rpc,采用register方式

This commit is contained in:
boyce
2020-12-21 16:34:06 +08:00
parent ce2a14fa83
commit 4b67c59b1e
10 changed files with 294 additions and 194 deletions

View File

@@ -177,7 +177,7 @@ func (client *Client) AsyncCall(rpcHandler IRpcHandler,serviceMethod string,call
}
seq := client.generateSeq()
request:=MakeRpcRequest(processor,seq,serviceMethod,false,InParam)
request:=MakeRpcRequest(processor,seq,0,serviceMethod,false,InParam)
bytes,err := processor.Marshal(request.RpcRequestData)
ReleaseRpcRequest(request)
if err != nil {
@@ -206,13 +206,13 @@ func (client *Client) AsyncCall(rpcHandler IRpcHandler,serviceMethod string,call
return nil
}
func (client *Client) RawGo(processor IRpcProcessor,noReply bool,serviceMethod string,args []byte,reply interface{}) *Call {
func (client *Client) RawGo(processor IRpcProcessor,noReply bool,rpcMethodId uint32,serviceMethod string,args []byte,reply interface{}) *Call {
call := MakeCall()
call.ServiceMethod = serviceMethod
call.Reply = reply
call.Seq = client.generateSeq()
request := MakeRpcRequest(processor,call.Seq,serviceMethod,noReply,args)
request := MakeRpcRequest(processor,call.Seq,rpcMethodId,serviceMethod,noReply,args)
bytes,err := processor.Marshal(request.RpcRequestData)
ReleaseRpcRequest(request)
if err != nil {
@@ -250,7 +250,7 @@ func (client *Client) Go(noReply bool,serviceMethod string, args interface{},rep
return call
}
return client.RawGo(processor,noReply,serviceMethod,InParam,reply)
return client.RawGo(processor,noReply,0,serviceMethod,InParam,reply)
}
func (client *Client) Run(){