diff --git a/rpc/rpchandler.go b/rpc/rpchandler.go index 2e4aef2..c99e791 100644 --- a/rpc/rpchandler.go +++ b/rpc/rpchandler.go @@ -80,6 +80,7 @@ type IRpcHandler interface { CallNode(nodeId int,serviceMethod string,args interface{},reply interface{}) error GoNode(nodeId int,serviceMethod string,args interface{}) error RawGoNode(rpcProcessorType RpcProcessorType,nodeId int,serviceMethod string,args IRawInputArgs) error + CastGo(serviceMethod string,args interface{}) IsSingleCoroutine() bool } diff --git a/service/module.go b/service/module.go index 9fc38bb..3b24d80 100644 --- a/service/module.go +++ b/service/module.go @@ -134,6 +134,7 @@ func (m *Module) ReleaseModule(moduleId int64){ pModule.dispatcher = nil pModule.ancestor = nil pModule.descendants = nil + pModule.IRpcHandler = nil } func (m *Module) NewModuleId() int64{ diff --git a/service/service.go b/service/service.go index 130a2ca..267a438 100644 --- a/service/service.go +++ b/service/service.go @@ -61,7 +61,7 @@ func (s *Service) Init(iService IService,getClientFun rpc.FuncRpcClient,getServe s.dispatcher =timer.NewDispatcher(timerDispatcherLen) s.rpcHandler.InitRpcHandler(iService.(rpc.IRpcHandler),getClientFun,getServerFun) - s.IRpcHandler = s + s.IRpcHandler = &s.rpcHandler s.self = iService.(IModule) //初始化祖先 s.ancestor = iService.(IModule)