HostingAbstractionsHostExtensions.StopAsync(IHost, TimeSpan) 方法

定义

尝试在指定超时内正常停止主机。Attempts to gracefully stop the host with the given timeout.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task ^ StopAsync(Microsoft::Extensions::Hosting::IHost ^ host, TimeSpan timeout);
public static System.Threading.Tasks.Task StopAsync (this Microsoft.Extensions.Hosting.IHost host, TimeSpan timeout);
static member StopAsync : Microsoft.Extensions.Hosting.IHost * TimeSpan -> System.Threading.Tasks.Task
<Extension()>
Public Function StopAsync (host As IHost, timeout As TimeSpan) As Task

参数

host
IHost

要停止的 IHostThe IHost to stop.

timeout
TimeSpan

正常停止的超时值。The timeout for stopping gracefully. 过期后,服务器可能会终止所有剩余的活动连接。Once expired the server may terminate any remaining active connections.

返回

Task

表示异步操作的 TaskThe Task that represents the asynchronous operation.

适用于