Share via


HttpWebRequest.ReadWriteTimeout Property

Gets or sets a timeout in milliseconds when writing to or reading from a stream.

Namespace: System.Net
Assembly: System (in system.dll)

Syntax

public int ReadWriteTimeout { get; set; }

Property Value

The number of milliseconds before the writing or reading times out. The default value is 300,000 milliseconds (5 minutes).

Remarks

This property is used to control the timeout when calling Stream.Read Method and Stream.Write Method. This property affects Stream instances that are returned from the GetResponse().WebResponse.GetResponseStream method and GetResponse().HttpWebRequest.GetRequestStream method.

Exceptions

Exception type Condition
InvalidOperationException The timeout cannot be changed, because the request was already submitted.
ArgumentOutOfRangeException The timeout is not a valid value.

Version Information

Available in the .NET Micro Framework versions 4.0 and 4.1.

See Also

Reference

HttpWebRequest Class
HttpWebRequest Members
System.Net Namespace