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

 property IVector<Platform::String ^> ^ SupportedProtocols { IVector<Platform::String ^> ^ get(); };
IVector<winrt::hstring> SupportedProtocols();
public IList<string> SupportedProtocols { get; }
var iVector = messageWebSocketControl.supportedProtocols;
Public ReadOnly Property SupportedProtocols As IList(Of String)

Property Value



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



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.

Applies to

See also