MessageWebSocketControl.MaxMessageSize Property


The maximum message size, in bytes, for a WebSocket message to be configured on the MessageWebSocket object.

 property unsigned int MaxMessageSize { unsigned int get(); void set(unsigned int value); };
uint32_t MaxMessageSize();

void MaxMessageSize(uint32_t value);
public uint MaxMessageSize { get; set; }
var uInt32 = messageWebSocketControl.maxMessageSize;
messageWebSocketControl.maxMessageSize = uInt32;
Public Property MaxMessageSize As UInteger

Property Value



The maximum message size, in bytes, to be configured on the MessageWebSocket object.


The MaxMessageSize property is used to configure the maximum size of a WebSocket message on a MessageWebSocket object. If a message exceeds this size, MessageReceived event will be raised on the MessageWebSocket object, and the GetDataReader or GetDataStream method on the MessageWebSocketMessageReceivedEventArgs callback parameter will fail (with an error code indicating that the maximum message size has been exceeded).

The default value for the MaxMessageSize property is INFINITE.

The MaxMessageSize property can only be set before calling the ConnectAsync method on the MessageWebSocket object. If the MessageWebSocket is already connected, an attempt to set this property will return an error.

Applies to

See also