ServiceHostBase.OnClose(TimeSpan) 方法

定义

关闭所承载服务,包括它们的通道调度程序以及相关的实例上下文和侦听器。Closes down the hosted service, including their channel dispatchers and associated instance contexts and listeners.

protected:
 override void OnClose(TimeSpan timeout);
protected override void OnClose (TimeSpan timeout);
override this.OnClose : TimeSpan -> unit
Protected Overrides Sub OnClose (timeout As TimeSpan)

参数

timeout
TimeSpan

TimeSpan,指定在超时前必须完成关闭操作的时间。The TimeSpan that specifies how long the on-close operation has to complete before timing out.

注解

调用 OnClose(TimeSpan) 会执行以下操作:Calling OnClose(TimeSpan) does the following:

适用于