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.
This topic has not yet been rated - Rate this topic

MessageWebSocketControl class

Provides socket control data on a MessageWebSocket.

Syntax


var messageWebSocketControl = MessageWebSocket.Control;

Attributes

DualApiPartitionAttribute()
MarshalingBehaviorAttribute(Agile)
VersionAttribute(NTDDI_WIN8)

Members

The MessageWebSocketControl class has these types of members:

Methods

The MessageWebSocketControl class inherits methods from the Object class (C#/VB/C++).

Properties

The MessageWebSocketControl class has these properties.

PropertyAccess typeDescription

MaxMessageSize

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

MessageType

Read/writeThe WebSocket message type to be configured on a MessageWebSocket object for write operations.

OutboundBufferSizeInBytes

Read/writeThe size, in bytes, of the send buffer to be used for sending data on a MessageWebSocket object.

ProxyCredential

Read/writeThe credential to use to authenticate to the proxy server through HTTP header authentication using a MessageWebSocket object.

ServerCredential

Read/writeThe credential to use to authenticate to the WebSocket server through HTTP header authentication using a MessageWebSocket object.

SupportedProtocols

Read-onlyGets a collection that can be used to add a list of supported sub-protocols that will be advertised to the server during the connect handshake.

 

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.


var clientWebSocket = new Windows.Networking.Sockets.MessageWebSocket();

// Get the current setting for this option
// This isn't required, but it shows how to get the current setting
var currentSetting = clientWebSocket.control.messageType;

// Set messageType to binary 
clientWebSocket.control.messageType = Windows.Networking.Sockets.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

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Namespace

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

Metadata

Windows.winmd

DLL

Windows.Networking.dll

See also

MessageWebSocket
How to use advanced WebSocket controls

 

 

Build date: 2/25/2013

© 2013 Microsoft. All rights reserved.