mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-16 09:24:47 +08:00
优化原始rpc,采用register方式
This commit is contained in:
@@ -127,7 +127,7 @@ func (agent *RpcAgent) Run() {
|
||||
}
|
||||
|
||||
//解析head
|
||||
req := MakeRpcRequest(processor,0,"",false,nil)
|
||||
req := MakeRpcRequest(processor,0,0,"",false,nil)
|
||||
err = processor.Unmarshal(data[1:],req.RpcRequestData)
|
||||
agent.conn.ReleaseReadMsg(data)
|
||||
if err != nil {
|
||||
@@ -222,7 +222,7 @@ func (server *Server) myselfRpcHandlerGo(handlerName string,serviceMethod string
|
||||
}
|
||||
|
||||
|
||||
func (server *Server) selfNodeRpcHandlerGo(processor IRpcProcessor,client *Client,noReply bool,handlerName string,serviceMethod string, args interface{},reply interface{},inputArgs IRawInputArgs) *Call {
|
||||
func (server *Server) selfNodeRpcHandlerGo(processor IRpcProcessor,client *Client,noReply bool,handlerName string,rpcMethodId uint32,serviceMethod string, args interface{},reply interface{},inputArgs IRawInputArgs) *Call {
|
||||
pCall := MakeCall()
|
||||
pCall.Seq = client.generateSeq()
|
||||
|
||||
@@ -242,7 +242,7 @@ func (server *Server) selfNodeRpcHandlerGo(processor IRpcProcessor,client *Clien
|
||||
if processor == nil {
|
||||
_,processor = GetProcessorType(args)
|
||||
}
|
||||
req := MakeRpcRequest(processor,0, serviceMethod,noReply,nil)
|
||||
req := MakeRpcRequest(processor,0,rpcMethodId, serviceMethod,noReply,nil)
|
||||
|
||||
req.bLocalRequest = true
|
||||
req.localParam = args
|
||||
@@ -285,7 +285,7 @@ func (server *Server) selfNodeRpcHandlerAsyncGo(client *Client,callerRpcHandler
|
||||
}
|
||||
|
||||
_,processor := GetProcessorType(args)
|
||||
req := MakeRpcRequest(processor,0,serviceMethod,noReply,nil)
|
||||
req := MakeRpcRequest(processor,0,0,serviceMethod,noReply,nil)
|
||||
req.localParam = args
|
||||
req.localReply = reply
|
||||
req.bLocalRequest = true
|
||||
|
||||
Reference in New Issue
Block a user