示例#1
0
        public HttpClusterApi()
        {
            DefaultNode = new ApiNode("*");

            DetectionTime   = 2000;
            mDetectionTimer = new System.Threading.Timer(OnVerifyClients, null, DetectionTime, DetectionTime);

            TimeOut = 30000;
        }
示例#2
0
        public ApiNode GetNode()
        {
            ApiNode result = new ApiNode(Name);

            foreach (var item in Hosts)
            {
                result.Add(item.Name, item.Weight);
            }
            return(result);
        }
示例#3
0
        private IApiNode CreateUrlNode(string url)
        {
            IApiNode node = new ApiNode(url);

            mNodes[node.Url] = node;
            ApiNodeAgent nodeAgent = new ApiNodeAgent();

            nodeAgent.Node    = node;
            nodeAgent.Url     = url;
            mAgents[node.Url] = nodeAgent;
            ChangeVersion();
            return(node);
        }