MessageWebSocketControl Class

Provides socket control data on a MessageWebSocket.

Syntax

public ref class MessageWebSocketControl sealed : IWebSocketControl  

Remarks

A MessageWebSocketControl object is automatically created with the parent MessageWebSocket object. The MessageWebSocket.Control property provides access to the associated MessageWebSocketControl object.

The following example creates a MessageWebSocket, and then demonstrates how to set the MessageWebSocketControl.MessageType property to binary. (Other properties may be set in a similar manner.) After this is done, the app can connect the MessageWebSocket.

Example

C++

using namespace Windows::Networking::Sockets;

MessageWebSocket^ clientWebSocket = ref new MessageWebSocket();

// Get the current setting for this option
// This isn't required, but it shows how to get the current setting
SocketMessageType currentSetting = clientWebSocket->Control->MessageType;

// Set messageType to binary 
clientWebSocket->Control->MessageType = SocketMessageType::Binary;

// Now you can call the ConnectAsync method to connect the MessageWebSocket.  

For more information about using MessageWebSocketControl, see How to use advanced WebSocket controls.

Requirements

Namespace: Windows.Networking.Sockets

Metadata: windows.winmd

See also

Reference

MessageWebSocketControl Members

Windows.Networking.Sockets Namespace