Läs på engelska Redigera

Dela via


ReliableSession Class

Definition

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

public class ReliableSession
Inheritance
ReliableSession
Derived

Examples

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);
reliableSession.Ordered = false;
Console.WriteLine("The new value for the Ordered property is: {0}", reliableSession.Ordered);

Remarks

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 one changes the value of the other too. This class gathers these two properties of reliable session binding element together for better discoverability.

Constructors

ReliableSession()

Initializes a new instance of the ReliableSession class.

ReliableSession(ReliableSessionBindingElement)

Initializes a new instance of the ReliableSession class from a reliable session binding element.

Properties

InactivityTimeout

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

Ordered

Gets or sets a value that indicates whether message delivery must preserve the order in which messages are sent.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

Produkt Versioner
.NET 8 (package-provided)
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)