ServiceHostBase.CloseTimeout 屬性

定義

取得或設定允許服務主機關閉的時間間隔。Gets or sets the interval of time allowed for the service host to close.

public:
 property TimeSpan CloseTimeout { TimeSpan get(); void set(TimeSpan value); };
public TimeSpan CloseTimeout { get; set; }
member this.CloseTimeout : TimeSpan with get, set
Public Property CloseTimeout As TimeSpan

屬性值

TimeSpan

TimeSpan,指定允許服務主機關閉的時間間隔。The TimeSpan that specifies the interval of time allowed for the service host to close.

例外狀況

這個值 (以毫秒為單位) 小於零或大於 MaxValue (2,147,483,647 或者以 16 進位表示的 0X7FFFFFFF)。The value, in milliseconds, is less than zero or is larger than MaxValue (2,147,483,647 or, in hexadecimal notation, 0X7FFFFFFF).

主機處於 OpeningClosing 狀態,無法修改。The host is in an Opening or Closing state and cannot be modified.

主機已處於 Closed 狀態,無法修改。The host is already in a Closed state and cannot be modified.

主機處於 Faulted 狀態,無法修改。The host is in a Faulted state and cannot be modified.

範例

TimeSpan closeTimeout = hostDefault.CloseTimeout;

適用於