Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
Binding Class
 ReceiveTimeout Property
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
Binding..::.ReceiveTimeout Property

Gets or sets the interval of time that a connection can remain inactive, during which no application messages are received, before it is dropped.

Namespace:  System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)
Visual Basic (Declaration)
Public Property ReceiveTimeout As TimeSpan
Visual Basic (Usage)
Dim instance As Binding
Dim value As TimeSpan

value = instance.ReceiveTimeout

instance.ReceiveTimeout = value
C#
public TimeSpan ReceiveTimeout { get; set; }
Visual C++
public:
virtual property TimeSpan ReceiveTimeout {
    TimeSpan get () sealed;
    void set (TimeSpan value) sealed;
}
JScript
public final function get ReceiveTimeout () : TimeSpan
public final function set ReceiveTimeout (value : TimeSpan)

Property Value

Type: System..::.TimeSpan
The Timespan that specifies how long the application has to receive a message before timing out. The default value is 10 minute.

Implements

IDefaultCommunicationTimeouts..::.ReceiveTimeout
ExceptionCondition
ArgumentOutOfRangeException

The value is less than zero or too large.

When using a reliable session, there are two different inactivity timers that must be satisfied to keep the connection alive. If either of these inactivity timers goes off, then the connection is dropped.

  • The first inactivity timer is on the reliable session and is called the InactivityTimeout. This inactivity timer fires if no messages, either application or infrastructure, are received within the timeout period. An infrastructure message is a message that is generated for the purpose of one of the protocols in the channel stack, such as a keep alive or an acknowledgment, rather than containing application data.

  • The second inactivity timer is on the service and uses the ReceiveTimeout setting of the binding. This inactivity timer fires if no application messages are received within the timeout period. This specifies, for example, the maximum time a client may take to send at least one message to the server before the server will close the channel used by a session. This behavior ensures that clients cannot hold on to server resources for arbitrary long periods.

Since the connection is dropped if either inactivity timer fires, increasing InactivityTimeout once it is greater than ReceiveTimeout has no effect. The default for both of these timeouts is 10 minutes, so you always have to increase both of them to make a difference when using a reliable session.

If transaction flow is enabled on the binding or the channel, the operation may take longer to execute than the specified timeout. In these circumstances the operation fails due to the expired timeout and the transaction aborts appropriately.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0

.NET Compact Framework

Supported in: 3.5
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
ReceiveTimeout for sessionful server channels      Gerke Geurts   |   Edit   |   Show History
For sessionful server channels (any channel using TCP for example) the ReceiveTimeout specifies the maximum time a client may take to send at least one message to the server before the server will close the channel. This behaviour ensures that clients cannot hold on to server resources for arbitrary long periods.

See http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1748577 for additional information.
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker