ReliableSession Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides convenient access to the properties of a reliable session binding element that are available when using one of the system-provided bindings.
public ref class ReliableSession
public class ReliableSession
type ReliableSession = class
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);
' Create a new reliable session object
Dim bindingElement As ReliableSessionBindingElement = New ReliableSessionBindingElement()
Dim reliableSession As 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) |