Пример #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);
        }