// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Features;
namespace Microsoft.AspNetCore.Hosting.Server
{
///
/// Represents a server.
///
public interface IServer : IDisposable
{
///
/// A collection of HTTP features of the server.
///
IFeatureCollection Features { get; }
///
/// Start the server with an application.
///
/// An instance of .
/// The context associated with the application.
/// Indicates if the server startup should be aborted.
Task StartAsync(IHttpApplication application, CancellationToken cancellationToken);
///
/// Stop processing requests and shut down the server, gracefully if possible.
///
/// Indicates if the graceful shutdown should be aborted.
Task StopAsync(CancellationToken cancellationToken);
}
}