Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

MessageWebSocketControl.MaxMessageSize | maxMessageSize property

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

Syntax


var maxMessageSize = messageWebSocketControl.maxMessageSize;
messageWebSocketControl.maxMessageSize = maxMessageSize;

Property value

Type: Number [JavaScript] | System.UInt32 [.NET] | uint32 [C++]

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

Remarks

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.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.winmd

See also

Other resources
How to use advanced WebSocket controls (HTML)
How to use advanced WebSocket controls (XAML)
Reference
MessageWebSocket
MessageWebSocketControl

 

 

Show:
© 2015 Microsoft