/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { if (_httpServer != null && _httpServer.IsStarted) { _httpServer.StopAsync(); } }
/// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> protected virtual void Dispose(bool disposing) { if (_httpServer != null) { _httpServer.StopAsync(); } }
public void Stop() { var result = _httpServer?.StopAsync(); if (result != null) { result.Wait(); //wait for stop to actually happen } }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { if (_httpServer != null && _httpServer.IsStarted) { _httpServer.StopAsync(); } if (_watcher != null) { _watcher.EnableRaisingEvents = false; _watcher.Dispose(); _watcher = null; } }
public void Stop() { var result = _httpServer?.StopAsync(); result?.Wait(); // wait for stop to actually happen }
public void Stop() { _httpServer?.StopAsync(); }
/// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> protected virtual void Dispose(bool disposing) { _httpServer?.StopAsync(); }