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.
| Property | Access type | Description |
|---|---|---|
| Read/write | The maximum message size, in bytes, for a WebSocket message to be configured on the MessageWebSocket object. | |
| Read/write | The WebSocket message type to be configured on a MessageWebSocket object for write operations. | |
| Read/write | The size, in bytes, of the send buffer to be used for sending data on a MessageWebSocket object. | |
| Read/write | The credential to use to authenticate to the proxy server through HTTP header authentication using a MessageWebSocket object. | |
| Read/write | The credential to use to authenticate to the WebSocket server through HTTP header authentication using a MessageWebSocket object. | |
| Read-only | Gets 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 |
|
|
Metadata |
|
|
DLL |
|
See also
Build date: 2/25/2013
