示例#1
0
        protected void LoadLiveProxy()
        {
            proxys.Clear();
            try
            {
                var nodes = zooKeeper.GetChildren("/live_nodes/proxy", new LiveProxyWatcher(this));

                foreach (var node in nodes)
                {
                    var d = GetData("/live_nodes/proxy/" + node);

                    proxys.Add(new LiveProxy
                    {
                        BaseUrl = IPHelper.FixLocalUrl(node),
                        Type    = LiveProxy.GetType(d)
                    });
                }
            }
            catch (Exception ex)
            {
            }
        }
示例#2
0
        protected void LoadLiveProxy()
        {
            proxys.Clear();
            try
            {
                var nodes = zooKeeper.getChildrenAsync("/live_nodes/proxy", new LiveProxyWatcher(this)).Result.Children;

                foreach (var node in nodes)
                {
                    var d = GetData("/live_nodes/proxy/" + node);

                    proxys.Add(new LiveProxy
                    {
                        BaseUrl = IPHelper.FixLocalUrl(node),
                        Type    = LiveProxy.GetType(d)
                    });
                }
            }
            catch (Exception ex)
            {
                Logger.GetLogger("").Error(ex.Message);
            }
        }