Add API docs for WebSockets and Kestrel sockets transport #17205 (#17943)

This commit is contained in:
Christian Kadluba 2019-12-19 19:55:32 +01:00 committed by Chris Ross
parent bc0c7121ef
commit 52534500d8
2 changed files with 28 additions and 1 deletions

View File

@ -7,8 +7,20 @@ using Microsoft.Extensions.Options;
namespace Microsoft.AspNetCore.Builder
{
/// <summary>
/// <see cref="IApplicationBuilder" /> extension methods to add and configure <see cref="WebSocketMiddleware" />.
/// </summary>
public static class WebSocketMiddlewareExtensions
{
/// <summary>
/// Adds the <see cref="WebSocketMiddleware" /> to the request pipeline.
/// </summary>
/// <param name="app">
/// The <see cref="IApplicationBuilder" /> to configure.
/// </param>
/// <returns>
/// The <see cref="IApplicationBuilder" />.
/// </returns>
public static IApplicationBuilder UseWebSockets(this IApplicationBuilder app)
{
if (app == null)
@ -19,6 +31,18 @@ namespace Microsoft.AspNetCore.Builder
return app.UseMiddleware<WebSocketMiddleware>();
}
/// <summary>
/// Adds the <see cref="WebSocketMiddleware" /> to the request pipeline.
/// </summary>
/// <param name="app">
/// The <see cref="IApplicationBuilder" /> to configure.
/// </param>
/// <param name="options">
/// The <see cref="WebSocketOptions" /> to be used for the <see cref="WebSocketMiddleware" />.
/// </param>
/// <returns>
/// The <see cref="IApplicationBuilder" />.
/// </returns>
public static IApplicationBuilder UseWebSockets(this IApplicationBuilder app, WebSocketOptions options)
{
if (app == null)
@ -33,4 +57,4 @@ namespace Microsoft.AspNetCore.Builder
return app.UseMiddleware<WebSocketMiddleware>(Options.Create(options));
}
}
}
}

View File

@ -8,6 +8,9 @@ using Microsoft.Extensions.DependencyInjection;
namespace Microsoft.AspNetCore.Hosting
{
/// <summary>
/// <see cref="IWebHostBuilder" /> extension methods to configure the Socket transport to be used by Kestrel.
/// </summary>
public static class WebHostBuilderSocketExtensions
{
/// <summary>