public MainFrm() { InitializeComponent(); WebRequest.DefaultWebProxy = null; var pinger = new Pinger(ConfigurationManager.AppSettings["HydraServers"].Split(',').Select(s => s.Trim())); pinger.RefreshSync(); var servers = pinger.ServerInfo.Where(si => si.IsReachable).Select(si => si.Address); string pollSetting = ConfigurationManager.AppSettings["PollIntervalMs"]; int? pollIntervalMs = pollSetting == null ? (int?)null : int.Parse(pollSetting); var hydraService = new StdHydraService(new NearestServerProvider(servers, ConfigurationManager.AppSettings["Database"], 5984), new ListenerOptions { PollIntervalMs = pollIntervalMs }); _dataSubscriber = new Subscriber<StressTestData>(hydraService); _dataSubscription = _dataSubscriber.ObserveOn(SynchronizationContext.Current).SkipErrors().Subscribe(OnDataRecv); _errorSubscriber = new Subscriber<StressTestError>(hydraService); _errorSubscription = _errorSubscriber.ObserveOn(SynchronizationContext.Current).SkipErrors().Subscribe(OnErrorRecv); _listener = hydraService.GetListener(new HydraByTopicByDestinationMessageFetcher(typeof(StressTestControl).FullName, "StressTestConsole")); _controlSubscription = _listener.ObserveOn(SynchronizationContext.Current).Subscribe(OnControlRecv); _controlPublisher = new Publisher<StressTestControl>(hydraService) {ThisParty = "StressTestConsole"}; }