HttpRequest.TimedOutToken HttpRequest.TimedOutToken HttpRequest.TimedOutToken HttpRequest.TimedOutToken Property

定義

取得要求逾時已過時觸動的 CancellationToken 物件。Gets a CancellationToken object that is tripped when a request times out.

public:
 property System::Threading::CancellationToken TimedOutToken { System::Threading::CancellationToken get(); };
public System.Threading.CancellationToken TimedOutToken { get; }
member this.TimedOutToken : System.Threading.CancellationToken
Public ReadOnly Property TimedOutToken As CancellationToken

屬性值

取消語彙基元。The cancellation token.

備註

可以在 Web.config 檔案中指定的逾時期限 (請參閱HttpRuntimeSection.ExecutionTimeout) 或以程式設計方式 (請參閱HttpServerUtility.ScriptTimeout)。The timeout period can be specified in the Web.config file (see HttpRuntimeSection.ExecutionTimeout) or programmatically (see HttpServerUtility.ScriptTimeout). 在逾時期限是從要求傳入時開始計算。The timeout period is measured from the time the request comes in. 110 秒的預設逾時作用中時,如果將不得早於 110 秒的要求處理開始之後觸動的取消語彙基元。If the default timeout of 110 seconds is in effect, the cancellation token will be tripped no earlier than 110 seconds after request processing begins. 您可以變更HttpServerUtility.ScriptTimeout屬性值,因為尚未尚未觸動長這個語彙基元,會遵守這項新的逾時值。You can change the HttpServerUtility.ScriptTimeout property value, and as long this token hasn't tripped yet, the new timeout value will be respected.

目前語彙基元,只提供 15 的第二個資料粒度,這表示如果逾時值為 110 秒,權杖會再要求處理開始之後的 110 和 125 秒之間的一段時間。Currently the token only provides 15 second granularity, which means that if the timeout value is 110 seconds, the token will be tripped sometime between 110 and 125 seconds after request processing begins. 資料粒度可能會在未來變更。The granularity may change in the future.

雖然這個屬性是安全執行緒,有其用途限制。Even though this property is thread-safe, there are restrictions on its use. 如需詳細資訊,請參閱HttpResponse.ClientDisconnectedTokenFor more information, see HttpResponse.ClientDisconnectedToken.

這個屬性就沒有意義,如果 Websocket 要求處理已開始。This property is meaningless if WebSockets request processing has started.

適用於