public void Stop() { _logger.Info("Stopping ASP.NET Web Host"); cts.Cancel(); _webHost?.StopAsync(_allocationCancellationToken); _logger.Info("ASP.NET Web Host Stopped"); }
public void Stop() { _server?.StopAsync().GetAwaiter().GetResult(); _server?.WaitForShutdownAsync().GetAwaiter().GetResult(); _server?.Dispose(); _server = null; }
public void Stop() { var cancellation = new CancellationTokenSource(TimeSpan.FromSeconds(15)); _webHost?.StopAsync(cancellation.Token) .GetAwaiter() .GetResult(); }
private void StopHost(IWebHost host) { try { host?.StopAsync(TimeSpan.FromSeconds(5)).ContinueWith(t => host?.Dispose()); } catch (Exception) { } }
/// <summary> /// Stops the service. /// </summary> public void Stop() { Logger.Debug("Stopping Web API"); _webApp?.StopAsync(); _webApp?.Dispose(); _webApp = null; Logger.Info("Successfully stopped web API"); }
public void Dispose() { _server?.Dispose(); _server = null; _downstreamApiHost?.StopAsync(); _downstreamApiHost?.Dispose(); _downstreamApiHost = null; }
/// <inheritdoc /> protected virtual void Dispose(bool disposing) { if (disposing) { host?.StopAsync().ConfigureAwait(false).GetAwaiter().GetResult(); host?.Dispose(); host = null; } }
public void Dispose() { if (!isDisposed) { _webhost?.StopAsync().Wait(); _engine?.Dispose(); } isDisposed = true; }
public static void Stop() { try { host?.StopAsync().Wait(); host?.Dispose(); } catch { /* NOOP */ } }
public bool Stop() { webHost?.StopAsync().ContinueWith(s => { if (s.IsFaulted) { _logger.Error($"Stopping service error! \nException:\n {s.Exception}"); } webHost?.Dispose(); }); return(true); }
public async Task <bool> Stop() { if (!IsRunning) { return(false); } await webHost?.StopAsync(); webHost?.Dispose(); webHost = null; return(true); }
public async Task StopAsync() { try { await(_webHost?.StopAsync() ?? Task.CompletedTask); if (_logger.IsInfo) { _logger.Info("JSON RPC service stopped"); } } catch (Exception e) { if (_logger.IsInfo) { _logger.Info($"Error when stopping JSON RPC service: {e}"); } } }
public async Task Stop() { await _webHost.StopAsync(Token); }
public void Stop() { _host?.StopAsync().Wait(); }
public override void Dispose() { _host?.StopAsync(); }
public void StopService() { _webHost.StopAsync(TimeSpan.FromSeconds(3)).Wait(); }
public void Stop() { host?.StopAsync(default(CancellationToken)).ConfigureAwait(false).GetAwaiter().GetResult(); }
public async Task Stop() { await webHost.StopAsync(); }
public override Task Stop() { return(_host?.StopAsync()); }
public Task Stop() { return(Server.StopAsync()); }
public void Dispose() { Browser.Dispose(); _host?.StopAsync(); }
public override void Dispose() { // This can be null if creating the webhost throws, we don't want to throw here and hide // the original exception. _host?.StopAsync(); }
public void TestCleanup() { _client?.Dispose(); _server?.StopAsync().Wait(); }
public void Stop() { _webApiHost.StopAsync().Wait(); }
public static void ShutDown() { _webHost?.StopAsync().Wait(); }
protected override void OnExit(ExitEventArgs e) { _host.StopAsync(); base.OnExit(e); }
public void StopServer() { _host?.StopAsync(); }
public async Task StopAsync() { await _host.StopAsync(TimeSpan.FromSeconds(5)); _host.Dispose(); }
//cleaning up public void stopChatServer() { _host?.StopAsync(); _server?.StopAsync(); }
/// <summary> /// Attempts to gracefully stop the host with the given timeout. /// </summary> /// <param name="host"></param> /// <param name="timeout">The timeout for stopping gracefully. Once expired the /// server may terminate any remaining active connections.</param> /// <returns></returns> public static Task StopAsync(this IWebHost host, TimeSpan timeout) { return(host.StopAsync(new CancellationTokenSource(timeout).Token)); }