SupportedProtocols | supportedProtocols property

MessageWebSocketControl.SupportedProtocols | supportedProtocols property

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.

Syntax


var supportedProtocols = messageWebSocketControl.supportedProtocols;

Property value

Type: IVector<String> [JavaScript/C++] | System.Collections.Generic.IList<String> [.NET]

A collection that contains the WebSocket sub-protocols supported by the MessageWebSocket object.

Remarks

The SupportedProtocols property contains a collection of WebSocket sub-protocols supported by the MessageWebSocket object. Before calling the ConnectAsync method, additional supported sub-protocol strings can be added to this collection, which will be sent to the server in the "Sec-WebSocket-Protocol" header during the WebSocket handshake. The mutually supported sub-protocol chosen by the WebSocket server will then be exposed on the Protocol property.

An attempt to add a sub-protocol to this collection after a successful call to ConnectAsync method will not result in an error but the new value is ignored. However, if the ConnectAsync method call or the connect operation completes with an error, an app can update the collection stored in the SupportedProtocols property and retry the ConnectAsync method call and the new value will be applied.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

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
MessageWebSocketInformation.Protocol

 

 

Show:
© 2016 Microsoft