public void Start() { _outputService.InfoLine($"Monitoring started for {_serverInfo.MachineName}"); _outputService.InfoLine(_transportService.GetInfo()); foreach (var service in _monitoringServices) { service.Start(); } while (true) { var pushData = GetDataToPush(); try { _outputService.Info("pushing... "); var elapsedTimeTask = _transportService.PushAsync(pushData); elapsedTimeTask.Wait(); _outputService.InfoLine("ok. " + elapsedTimeTask.Result + " ms"); Thread.Sleep(1000); } catch (WebException ex) { _outputService.InfoLine("webexception"); _outputService.InfoLine(ex.Message); Thread.Sleep(3000); } catch (Exception ex) { _outputService.InfoLine("exception"); _outputService.InfoLine(ex.Message); Thread.Sleep(3000); } } }