StreamWebSocketControl.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

public:
property IVector<String^ >^ SupportedProtocols {
         IVector<String^ >^ get ();
}  

Property value

Type: IVector<String^ > 

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

Remarks

The SupportedProtocols property contains a collection of WebSocket sub-protocols supported by the StreamWebSocket 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 app can update the collection stored in the SupportedProtocols property and retry the ConnectAsync method call.

Requirements

Namespace: Windows.Networking.Sockets

Metadata: windows.winmd

See also

Reference

StreamWebSocketControl Class

StreamWebSocketControl Members

Windows.Networking.Sockets Namespace