ReliableSession.InactivityTimeout Property

Gets or sets an interval of time that a service remains inactive before closing.

Namespace: System.ServiceModel
Assembly: System.ServiceModel (in system.servicemodel.dll)

public TimeSpan InactivityTimeout { get; set; }
/** @property */
public TimeSpan get_InactivityTimeout ()

/** @property */
public void set_InactivityTimeout (TimeSpan value)

public function get InactivityTimeout () : TimeSpan

public function set InactivityTimeout (value : TimeSpan)

Not applicable.

Property Value

The TimeSpan that specifies the interval of time that a service remains inactive before closing. The default value is 10 minutes.

Exception typeCondition


The value set is less than or equal to zero.

The property gets and sets the value of the InactivityTimeout property.

Activity on a channel is defined as receiving an application or infrastructure message. The inactivity timeout property controls the maximum amount of time to keep an inactive session alive. If more than the InactivityTimeout specified time interval passes with no activity, the session is aborted by the infrastructure and the channel faults. The reliable session is torn down unilaterally.

If the sending application has no messages to send then the reliable session is normally not faulted because of inactivity; instead a keep-alive mechanism keeps the session active indefinitely. Note that the dispatcher could independently abort the reliable session if no application messages are sent or received. Thus, the inactivity timeout typically expires if network conditions are such that no messages of any sort are received or if there is a failure on the sender.

Setting this timeout prevents the server from holding onto a security session if the client does not close it. If the security session has not received a message for the inactivity interval of time, it is closed by the server. This mitigates a potential denial of service attack.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions