BinaryMessageEncodingBindingElement.MaxSessionSize Property

Definition

Gets or sets the maximum amount of memory available within a session for optimizing transmission procedures.

C#
public int MaxSessionSize { get; set; }

Property Value

The maximum size, in bytes, of a session. The default value is 2048 bytes.

Exceptions

The value is less than or equal to zero.

Examples

C#
be.MaxSessionSize = 2048;

Remarks

The .NET Binary Format for XML can optimize the transmission of strings when they are used in multiple messages within a session. Once a string is sent in a message, additional messages that contain that string can refer to it using only the string's ID. This requires that the strings and their IDs be stored in memory. This allows the ID to be retransmitted in subsequent messages instead of the entire string. This lookup increases the efficiency of message transmission when using the binary format. The MaxSessionSize gets and sets the maximum amount of memory that is allocated to store these strings.

Applies to

Produkt Versiounen
.NET Core 1.0, Core 1.1, 8 (package-provided), 9 (package-provided), 10 (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, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
UWP 10.0