BlobRequestOptions.Timeout Property

Storage Client Library NET API

[This topic is part of the Microsoft Azure Storage Client Library 1.7, which has been deprecated. See Storage Client Library for the latest version.]

Gets or sets the service timeout for the request.

Namespace: Microsoft.WindowsAzure.StorageClient
Assembly: Microsoft.WindowsAzure.StorageClient (in Microsoft.WindowsAzure.StorageClient.dll)

Usage

Visual Basic
Dim instance As BlobRequestOptions
Dim value As Nullable(Of TimeSpan)

value = instance.Timeout

instance.Timeout = value

Syntax

Visual Basic
Public Property Timeout As Nullable(Of TimeSpan)
C#
public Nullable<TimeSpan> Timeout { get; set; }
C++
public:
property Nullable<TimeSpan> Timeout {
	Nullable<TimeSpan> get ();
	void set (Nullable<TimeSpan> value);
}
J#
JScript

Property Value

Type: System.Nullable

The service timeout interval for the request.

Example

The following code uploads a file to a blob using a timeout of 20 seconds for the operation.

C# Copy Code
var account = CloudStorageAccount.Parse
    ("AccountName=myaccount;AccountKey=mykey;DefaultEndpointsProtocol=http");
var blobClient = account.CreateCloudBlobClient();
var container = blobClient.GetContainerReference("testcontainer");
var blob = container.GetBlobReference("testblob");
BlobRequestOptions blobRequestOptions = new BlobRequestOptions();
blobRequestOptions.Timeout = TimeSpan.FromSeconds(20.0);
blob.UploadFile("myfile.txt", blobRequestOptions);

Remarks

Setting the Timeout property for an individual request overrides the setting of the Timeout property for that request.

The default timeout interval for a request made via the storage client library is 90 seconds, but the blob service enforces a shorter timeout in most cases. See Setting Timeouts for Blob Service Operations.


Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Vista, Windows 7, Windows Server 2008, Windows 8.1, Windows Server 2012 R2, Windows 8 and Windows Server 2012

Change History

See Also