/// <summary> /// Constructor /// </summary> /// <param name="config">Configuration.Configuration object</param> public Dispatcher(Configuration.ServiceConfig config) { logger.Info("starting init servers"); foreach (var server in config.Servers) { if (server.WeithtRate > 0) { var s = new Server(server); if (s.State != ServerState.Disable) { SocketPool sp = new SocketPool(s, config.SocketPool); s.ScoketPool = sp; ServerPool.Add(s); } } } logger.Info("init servers end"); }
private ServiceProxy(string serviceName) { _ServiceName = serviceName; config = Configuration.ServiceConfig.GetConfig(serviceName); dispatcher = new Com.Bj58.Spat.Gaea.Client.Loadbalance.Dispatcher(config); }