Esempio n. 1
0
        /// <summary>
        /// 获取配置信息
        /// </summary>
        /// <param name="serviceName">TCP调用服务名称</param>
        /// <param name="type">TCP服务器类型</param>
        /// <returns>TCP调用服务器端配置信息</returns>
        public static tcpServer GetConfig(string serviceName, Type type = null)
        {
            tcpServer attribute = null;

            if (type != null)
            {
                attribute = fastCSharp.code.typeAttribute.GetAttribute <tcpServer>(type, false, true);
                if (attribute != null)
                {
                    attribute = attribute.Clone();
                }
            }
            attribute = fastCSharp.config.pub.LoadConfig(attribute ?? new tcpServer(), serviceName);
            if (attribute.Service == null)
            {
                attribute.Service = serviceName;
            }
            return(attribute);
        }
Esempio n. 2
0
        ///// <summary>
        ///// 客户端队列初始容器大小(2^n)
        ///// </summary>
        //public byte AcceptQueueSize = 4;
#endif
        /// <summary>
        /// 获取配置信息
        /// </summary>
        /// <param name="type">TCP服务器类型</param>
        /// <returns>TCP调用服务器端配置信息</returns>
        public static tcpServer GetConfig(Type type)
        {
            tcpServer attribute = fastCSharp.code.typeAttribute.GetAttribute <tcpServer>(type, false, true);

            return(attribute != null?fastCSharp.config.pub.LoadConfig(attribute.Clone(), attribute.Service) : null);
        }