Mono Class Library: System.Net.WebRequest Overview | Members

System.Net.WebRequest.Timeout Property

Gets or sets the length of time before requests for resources time out. [Edit]

public virtual int Timeout { set; get; }

Value

A int containing the length of time, in milliseconds, before the current request will time out, or System.Threading.Timeout.Infinite to indicate that the request does not time out. [Edit]

Exceptions

TypeReason
NotSupportedExceptionThis property is not implemented in the derived class. [Edit]

Remarks

Operation
Classes that derive from System.Net.WebRequest are required to indicate a timeout by throwing a System.Net.WebException with the WebException.Status field set to WebExceptionStatus.Timeout if a request times out.

This property throws a NotSupportedException exception.

Note to Inheritors
This property must be overridden by classes that inherit from System.Net.WebRequest to provide this functionality.

Usage

Use this property to set the timeout period for requests for resources.

The WebRequest.Timeout property affects only synchronous requests made with the WebRequest.GetResponse method. To time out asynchronous requests, use the WebRequest.Abort method.

[Edit]

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0