ListenOptions 类

定义

描述 IPEndPointKestrel 应绑定到或打开的已打开的套接字的 、Unix 域套接字路径、命名管道名称或文件描述符。

public ref class ListenOptions : Microsoft::AspNetCore::Server::Kestrel::Transport::Abstractions::Internal::IEndPointInformation
public ref class ListenOptions : Microsoft::AspNetCore::Connections::IConnectionBuilder, Microsoft::AspNetCore::Server::Kestrel::Transport::Abstractions::Internal::IEndPointInformation
public ref class ListenOptions : Microsoft::AspNetCore::Connections::IConnectionBuilder
public class ListenOptions : Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal.IEndPointInformation
public class ListenOptions : Microsoft.AspNetCore.Connections.IConnectionBuilder, Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal.IEndPointInformation
public class ListenOptions : Microsoft.AspNetCore.Connections.IConnectionBuilder
public class ListenOptions : Microsoft.AspNetCore.Connections.IConnectionBuilder, Microsoft.AspNetCore.Connections.IMultiplexedConnectionBuilder
type ListenOptions = class
    interface IEndPointInformation
type ListenOptions = class
    interface IEndPointInformation
    interface IConnectionBuilder
type ListenOptions = class
    interface IConnectionBuilder
type ListenOptions = class
    interface IConnectionBuilder
    interface IMultiplexedConnectionBuilder
Public Class ListenOptions
Implements IEndPointInformation
Public Class ListenOptions
Implements IConnectionBuilder, IEndPointInformation
Public Class ListenOptions
Implements IConnectionBuilder
Public Class ListenOptions
Implements IConnectionBuilder, IMultiplexedConnectionBuilder
继承
ListenOptions
实现
Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal.IEndPointInformation IConnectionBuilder IMultiplexedConnectionBuilder

属性

ApplicationServices

获取应用程序 IServiceProvider

ConnectionAdapters

List<T>获取允许截获和转换每个连接的 Stream 。 由 UseHttps()UseConnectionLogging(ListenOptions) 扩展方法配置。

DisableAltSvcHeader

获取或设置一个值,该值控制响应标头是否包含“Alt-Svc”标头。 客户端使用“Alt-Svc”标头将 HTTP/1.1 和 HTTP/2 连接升级到 HTTP/3。

如果 Protocols 启用了 HTTP/1.1 或 HTTP/2,并且启用了 HTTP/3,“Alt-Svc”标头将自动包含在响应中。 如果应用已设置“Alt-Svc”标头值,则不会更改。

EndPoint

获取 EndPoint

FileHandle

获取套接字的绑定文件描述符。

HandleType

描述 IPEndPointKestrel 应绑定到或打开的已打开的套接字的 、Unix 域套接字路径、命名管道名称或文件描述符。

IPEndPoint

获取绑定 IPEndPoint的 。

KestrelServerOptions

KestrelServerOptions获取侦听器选项的 。 使连接中间件能够解析和使用应用程序在启动期间注册的服务。

NoDelay

设置为 false 可对所有连接启用 Nagle 算法。

PipeName

获取名称管道服务器的绑定管道名称。

Protocols

在此终结点上启用的协议。

SocketPath

获取 Unix 域套接字的绑定绝对路径。

Type

要描述的接口类型: IPEndPoint、Unix 域套接字路径或文件描述符。

方法

Build()

生成 ConnectionDelegate

Clone(IPAddress)

用于克隆到两个 IPEndpoint

ToString()

描述 IPEndPointKestrel 应绑定到或打开的已打开的套接字的 、Unix 域套接字路径、命名管道名称或文件描述符。

Use(Func<ConnectionDelegate,ConnectionDelegate>)

将中间件委托添加到连接管道。 由 UseHttps()UseConnectionLogging(ListenOptions) 扩展方法配置。

显式接口实现

IMultiplexedConnectionBuilder.Build()

描述 IPEndPointKestrel 应绑定到或打开的已打开的套接字的 、Unix 域套接字路径、命名管道名称或文件描述符。

IMultiplexedConnectionBuilder.Use(Func<MultiplexedConnectionDelegate,MultiplexedConnectionDelegate>)

描述 IPEndPointKestrel 应绑定到或打开的已打开的套接字的 、Unix 域套接字路径、命名管道名称或文件描述符。

扩展方法

Run(IConnectionBuilder, Func<ConnectionContext,Task>)

将给定 middleware 的 添加到连接。

Use(IConnectionBuilder, Func<ConnectionContext,ConnectionDelegate,Task>)

将给定 middleware 的 添加到连接。 如果不调用下一个函数,请改用 Run(IConnectionBuilder, Func<ConnectionContext,Task>)

Use(IConnectionBuilder, Func<ConnectionContext,Func<Task>,Task>)

将给定 middleware 的 添加到连接。 如果不调用下一个函数,请改用 Run(IConnectionBuilder, Func<ConnectionContext,Task>)

为了获得更好的性能,首选使用 Use(IConnectionBuilder, Func<ConnectionContext,ConnectionDelegate,Task>) ,如下所示:

builder.Use((context, next) =>
{
    return next(context);
});
UseConnectionHandler<TConnectionHandler>(IConnectionBuilder)

使用给定 TConnectionHandlerConnectionHandler的 。

UseConnectionTimeout(ListenOptions)

添加连接超时中间件。

UseConnectionLogging(ListenOptions)

发出从连接读取和写入连接的字节的详细日志。

UseConnectionLogging(ListenOptions, String)

发出从连接读取和写入连接的字节的详细日志。

UseHttps(ListenOptions)

配置 Kestrel 以将 HTTPS 与默认证书一起使用(如果可用)。 如果未配置默认证书,这将引发。

UseHttps(ListenOptions, HttpsConnectionAdapterOptions)

将 Kestrel 配置为使用 HTTPS。 这不使用默认证书或通过配置或 ConfigureHttpsDefaults(Action<HttpsConnectionAdapterOptions>)指定的其他默认值。

UseHttps(ListenOptions, TlsHandshakeCallbackOptions)

将 Kestrel 配置为使用 HTTPS。 这不使用默认证书或通过配置或 ConfigureHttpsDefaults(Action<HttpsConnectionAdapterOptions>)指定的其他默认值。

UseHttps(ListenOptions, Action<HttpsConnectionAdapterOptions>)

将 Kestrel 配置为使用 HTTPS。

UseHttps(ListenOptions, ServerOptionsSelectionCallback, Object)

将 Kestrel 配置为使用 HTTPS。 这不使用默认证书或通过配置或 ConfigureHttpsDefaults(Action<HttpsConnectionAdapterOptions>)指定的其他默认值。

UseHttps(ListenOptions, ServerOptionsSelectionCallback, Object, TimeSpan)

将 Kestrel 配置为使用 HTTPS。 这不使用默认证书或通过配置或 ConfigureHttpsDefaults(Action<HttpsConnectionAdapterOptions>)指定的其他默认值。

UseHttps(ListenOptions, StoreName, String)

将 Kestrel 配置为使用 HTTPS。

UseHttps(ListenOptions, StoreName, String, Boolean)

将 Kestrel 配置为使用 HTTPS。

UseHttps(ListenOptions, StoreName, String, Boolean, StoreLocation)

将 Kestrel 配置为使用 HTTPS。

UseHttps(ListenOptions, StoreName, String, Boolean, StoreLocation, Action<HttpsConnectionAdapterOptions>)

将 Kestrel 配置为使用 HTTPS。

UseHttps(ListenOptions, X509Certificate2)

将 Kestrel 配置为使用 HTTPS。

UseHttps(ListenOptions, X509Certificate2, Action<HttpsConnectionAdapterOptions>)

将 Kestrel 配置为使用 HTTPS。

UseHttps(ListenOptions, String)

将 Kestrel 配置为使用 HTTPS。

UseHttps(ListenOptions, String, String)

将 Kestrel 配置为使用 HTTPS。

UseHttps(ListenOptions, String, String, Action<HttpsConnectionAdapterOptions>)

将 Kestrel 配置为使用 HTTPS。

UseHub<THub>(IConnectionBuilder)

配置连接以托管指定 Hub 类型。

适用于