MaxBufferSize Property
Collapse the table of content
Expand the table of content

HttpTransportBindingElement.MaxBufferSize Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets or sets the maximum size of the buffer to use. For buffered messages this value is the same as MaxReceivedMessageSize. For streamed messages, this value is the maximum size of the SOAP headers, which must be read in buffered mode.

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

public int MaxBufferSize { get; set; }

Property Value

Type: System.Int32
The maximum size, in bytes, of the buffer.

For streamed messages, if the size of the message headers is greater than this property, then a QuotaExceededException is thrown. For a non-streamed message, if the message size is greater than this property, then the message is dropped.

If not specified, this defaults to 65536.


// Create an instance of the HttpTransportBindingElement
HttpTransportBindingElement httpTransportBindingElement = new HttpTransportBindingElement();
string txtDefaultMaxBufferSize = httpTransportBindingElement.MaxBufferSize.ToString();
txtOutput1.Text = txtDefaultMaxBufferSize;  //The value is 65536 (0x10000).

// Change the maximum buffer size.
httpTransportBindingElement.MaxBufferSize = 0x20000;
string txtNewMaxBufferSize = httpTransportBindingElement.MaxBufferSize.ToString();
txtOutput2.Text = txtNewMaxBufferSize; //The value is 131072 (0x20000).


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft