NetTcpBinding.MaxBufferSize 属性

定义

获取或设置一个值,该值指定内存中用于存储消息的缓冲区的最大大小(以字节为单位)。Gets or sets a value that specifies the maximum size, in bytes, of the buffer used to store messages in memory.

public:
 property int MaxBufferSize { int get(); void set(int value); };
public int MaxBufferSize { get; set; }
member this.MaxBufferSize : int with get, set
Public Property MaxBufferSize As Integer

属性值

内存中用于存储消息的缓冲区的最大大小(以字节为单位)。The maximum size, in bytes, of the buffer used to store messages in memory. 默认值为 65,536 字节。The default value is 65,536 bytes.

示例

此示例演示如何获取 MaxBufferSize的值。This example shows how to get the value of the MaxBufferSize.

int maxBufferSize = binding.MaxBufferSize;

注解

如果接收的数据超过了可进行缓冲处理的数据,则超出缓冲区大小的数据将保留在基础套接字中,直到缓冲区中具有可用于存储剩余数据的空间为止。If you receive more data than you can buffer, the data that exceeds the buffer size remains on the underlying socket until your buffer has room for the rest of the data.

适用于