MessageWebSocketControl.MessageType | messageType property

The WebSocket message type to be configured on a MessageWebSocket object for write operations.

Syntax


var messageType = messageWebSocketControl.messageType;
messageWebSocketControl.messageType = messageType;

Property value

Type: SocketMessageType

The WebSocket message type. The default is binary.

Remarks

A WebSocket message on the MessageWebSocket object can be either a binary message or a UTF-8 message. The default value is SocketMessageType.Binary.

This property only affects write operations on OutputStream. It does not affect the format of received messages.

The MessageType property can be changed at any time. This allows an app to switch between binary and UTF-8 messages when needed.

Before changing the MessageType on a bound or connected MessageWebSocket, any outgoing packets should first be flushed to ensure that all previously-written data is sent out with the previous message type

Requirements (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 (operating system)

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
SocketMessageType

 

 

Show:
© 2015 Microsoft