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

            DetectionTime = 2000;
            mDetectionTimer = new System.Threading.Timer(OnVerifyClients, null, DetectionTime, DetectionTime);
        }
コード例 #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;
     return node;
 }
コード例 #4
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);
        }