This documentation is archived and is not being maintained.

ReliableSession Class

Provides convenient access to the properties of a reliable session binding element that are available when using one of the system-provided bindings.

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

public class ReliableSession

The properties contained in the ReliableSession class are the subset of those contained in the ReliableSessionBindingElement that are accessible from a predefined binding. This subset consists of the InactivityTimeout and Ordered properties. The ReliableSession class references the same objects as does the ReliableSessionBindingElement, so changing the value of the one changes the value of the other too. This class gathers these two properties of reliable session binding element together for better discoverability.

The following example shows how to create a new reliable session, and access and change the property values of that session. The ReliableSession class allows you to write:

// Create a new reliable session object
ReliableSessionBindingElement bindingElement = new ReliableSessionBindingElement();
ReliableSession reliableSession = new ReliableSession(bindingElement);

// Now you can access property values
Console.WriteLine("Ordered: {0}", reliableSession.Ordered);
Console.WriteLine("InactivityTimeout: {0}", reliableSession.InactivityTimeout);
// </Snippit2>
reliableSession.Ordered = false;
Console.WriteLine("The new value for the Ordered property is: {0}", reliableSession.Ordered);

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

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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