Share via


你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

BlobRequestOptions.ServerTimeout 属性

定义

获取或设置单个 HTTP 请求的服务器超时间隔。

public TimeSpan? ServerTimeout { get; set; }
member this.ServerTimeout : Nullable<TimeSpan> with get, set
Public Property ServerTimeout As Nullable(Of TimeSpan)

属性值

包含 TimeSpan 每个 HTTP 请求的服务器超时间隔的 。

实现

示例


BlobRequestOptions timeoutRequestOptions = new BlobRequestOptions()
{
    // Each REST operation will timeout after 5 seconds.
    ServerTimeout = TimeSpan.FromSeconds(5),

    // Allot 30 seconds for this API call, including retries
    MaximumExecutionTime = TimeSpan.FromSeconds(30)
};

byteCount = blob.DownloadToByteArray(destinationArray, index: 0, accessCondition: null, options: timeoutRequestOptions);

注解

服务器超时是针对发出的每个 REST 请求发送到 Azure 存储服务的超时。 例如,如果调用的 API (UploadFromStream 进行多次 REST 调用,或者请求重试) ,则此超时将单独应用于每个请求。 此值不会在客户端上进行跟踪或验证,只会传递给存储服务。

适用于