Exemplo n.º 1
0
 private void MonitorServerStatus()
 {
     var httpWatcher = new HttpEndpointChecker(
         FrameworkDI.Configuration["SynthesisServer:HostUrl"],
         interval: 20000,
         logger: Framework.Provider.GetService <ILogger>(),
         stateChangedCallback: (result) =>
     {
         Di.ViewModelApplication.ServerReachable = result;
     });
 }
Exemplo n.º 2
0
 /// <summary>
 /// Monitors the fasetto website is up, running and reachable
 /// by periodically hitting it up
 /// </summary>
 private void MonitorServerStatus()
 {
     // Create a new endpoint watcher
     var httpWatcher = new HttpEndpointChecker(
         // Checking fasetto.chat
         Configuration["ANHServer:HostUrl"],
         // Every 20 seconds
         interval: 20000,
         // Pass in the DI logger
         logger: Framework.Provider.GetService <ILogger>(),
         // On change...
         stateChangedCallback: (result) =>
     {
         // Update the view model property with the new result
         ViewModelApplication.ServerReachable = result;
     });
 }