/// <summary>
/// Shuts down the System.Net.HttpListener object immediately, discarding all currently queued requests.
/// </summary>
public void Abort()
{
// If not running.
if (_running)
{
try
{
// Stop the service.
_running = false;
if (_listener != null)
{
_listener.Abort();
}
}
catch (Exception)
{
if (_listener != null)
{
_listener.Close();
}
throw;
}
}
}