IWebSocketControl.SupportedProtocols property

Applies to Windows and Windows Phone

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


IList<string> SupportedProtocols { get; }

Property value

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

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

Remarks

The SupportedProtocols property contains a collection of WebSocket sub-protocols supported by the IWebSocket 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 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 result in an error. However, if the ConnectAsync method call or the connect operation completes with an error, an appl can update the collection stored in the SupportedProtocols property and retry the ConnectAsync method call.

Requirements

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

IWebSocket
IWebSocketControl
IWebSocketInformation.Protocol
How to use advanced WebSocket controls

 

 

Show:
© 2014 Microsoft