示例#1
0
        /// <summary>
        /// 创建客户端
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="serverIp"></param>
        /// <param name="serverPort"></param>
        /// <returns></returns>
        public static F Client <F>(string config)
        {
            ServerConfig server = TConfigurationRoot.Bind <ServerConfig>(config);

            return(Client <F>(server.ServerIP, server.Port));
        }
示例#2
0
        /// <summary>
        /// 创建服务端
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="entity"></param>
        public static void Server <T>(T entity, string config) where T : TProcessor
        {
            ServerConfig server = TConfigurationRoot.Bind <ServerConfig>(config);

            Server <T>(entity, server.Port);
        }