/// <summary> /// 解析XML格式配置文件中的服务配置信息,并注册到server中。 /// </summary> /// <param name="server"></param> /// <param name="xmlCfgFile"></param> public static void RegisterServices(RPCServer server, string xmlCfgFile = null) { if (string.IsNullOrEmpty(xmlCfgFile)) { xmlCfgFile = Assembly.GetExecutingAssembly().Location + ".config"; if (!File.Exists(xmlCfgFile)) { xmlCfgFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? "", "dotNettyRPC.config"); } } foreach (var s in ParseXmlConfig(xmlCfgFile)) { server.RegisterService(s.Interface, s.Service); } }
public ServerHandler(RPCServer rPCServer) { _rpcServer = rPCServer; }