MessageWebSocketInformation MessageWebSocketInformation MessageWebSocketInformation MessageWebSocketInformation MessageWebSocketInformation Class

Definition

Provides socket information on a MessageWebSocket.

public : sealed class MessageWebSocketInformation : IWebSocketInformation, IWebSocketInformation2
struct winrt::Windows::Networking::Sockets::MessageWebSocketInformation : IWebSocketInformation, IWebSocketInformation2
public sealed class MessageWebSocketInformation : IWebSocketInformation, IWebSocketInformation2
Public NotInheritable Class MessageWebSocketInformation Implements IWebSocketInformation, IWebSocketInformation2
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

MessageWebSocketInformation can be called any time after the MessageWebSocket has been created.

A MessageWebSocketInformation object is automatically created with the parent MessageWebSocket object. The MessageWebSocket.Information property provides access to the associated MessageWebSocketInformation object.

Properties

BandwidthStatistics BandwidthStatistics BandwidthStatistics BandwidthStatistics BandwidthStatistics

Gets bandwidth information for network data transfer on a MessageWebSocket object.

Note that the returned statistics are based on extended TCP statistics, which are enabled by default on Client versions of Windows, but disabled by default for performance reasons on Server versions of Windows. If extended TCP statistics are not available, all returned numerical statistics are set to 0, and boolean statistics are set to false.

public : BandwidthStatistics BandwidthStatistics { get; }
BandwidthStatistics BandwidthStatistics();
public BandwidthStatistics BandwidthStatistics { get; }
Public ReadOnly Property BandwidthStatistics As BandwidthStatistics
var bandwidthStatistics = messageWebSocketInformation.bandwidthStatistics;
Value
BandwidthStatistics BandwidthStatistics BandwidthStatistics

Bandwidth information for network data transfer on a MessageWebSocket object.

See Also

LocalAddress LocalAddress LocalAddress LocalAddress LocalAddress

Gets the IP address associated with a MessageWebSocket object.

public : HostName LocalAddress { get; }
HostName LocalAddress();
public HostName LocalAddress { get; }
Public ReadOnly Property LocalAddress As HostName
var hostName = messageWebSocketInformation.localAddress;
Value
HostName HostName HostName

The IP address associated with a MessageWebSocket object.

See Also

Protocol Protocol Protocol Protocol Protocol

Gets the WebSocket sub-protocol negotiated with the server during WebSocket handshake on a MessageWebSocket object.

public : Platform::String Protocol { get; }
winrt::hstring Protocol();
public string Protocol { get; }
Public ReadOnly Property Protocol As string
var string = messageWebSocketInformation.protocol;
Value
string string string

The sub-protocol negotiated with the server during the WebSocket handshake.

Remarks

Both a WebSocket client and a WebSocket server may support multiple sub-protocols. During the WebSocket handshake, the server will select one of the sub-protocols from the mutually supported sub-protocols and reply in the "Sec-WebSocket-Protocol" header. The Protocol property will contain the selected sub-protocol string.

Before the MessageWebSocket is connected, this property is null.

See Also

ServerCertificate ServerCertificate ServerCertificate ServerCertificate ServerCertificate

Gets the certificate provided by the server when a secure WebSocket connection has been established.

public : Certificate ServerCertificate { get; }
Certificate ServerCertificate();
public Certificate ServerCertificate { get; }
Public ReadOnly Property ServerCertificate As Certificate
var certificate = messageWebSocketInformation.serverCertificate;
Value
Certificate Certificate Certificate

The server certificate.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

By the time the server certificate is available through this property, the SSL connection has already been established.

If you wish to inspect the server certificate during the connection process in order to perform custom validation, you should register a handler for the MessageWebSocket.ServerCustomValidationRequested event, and perform your custom server validation in that handler.

If you merely wish to ignore certain classes of error when the server certificate is validated (for example, you are using a self-signed certificate and wish to ignore the validation error caused by this condition) you can use the IgnorableServerCertificateErrors property to ignore the relevant classes of errors.

ServerCertificateErrors ServerCertificateErrors ServerCertificateErrors ServerCertificateErrors ServerCertificateErrors

Gets a list of the errors that occurred while establishing a secure WebSocket connection.

public : IVectorView<ChainValidationResult> ServerCertificateErrors { get; }
IVectorView<ChainValidationResult> ServerCertificateErrors();
public IReadOnlyList<ChainValidationResult> ServerCertificateErrors { get; }
Public ReadOnly Property ServerCertificateErrors As IReadOnlyList<ChainValidationResult>
var iReadOnlyList = messageWebSocketInformation.serverCertificateErrors;
Value
IReadOnlyList<ChainValidationResult> IReadOnlyList<ChainValidationResult> IReadOnlyList<ChainValidationResult>

A list of values describing secure connection errors.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

ServerCertificateErrorSeverity ServerCertificateErrorSeverity ServerCertificateErrorSeverity ServerCertificateErrorSeverity ServerCertificateErrorSeverity

Gets the category of an error that occurred making an SSL connection with a WebSocket server.

public : SocketSslErrorSeverity ServerCertificateErrorSeverity { get; }
SocketSslErrorSeverity ServerCertificateErrorSeverity();
public SocketSslErrorSeverity ServerCertificateErrorSeverity { get; }
Public ReadOnly Property ServerCertificateErrorSeverity As SocketSslErrorSeverity
var socketSslErrorSeverity = messageWebSocketInformation.serverCertificateErrorSeverity;
Value
SocketSslErrorSeverity SocketSslErrorSeverity SocketSslErrorSeverity

The category of error on an SSL connection.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

SSL server errors should only be ignored in advanced scenarios. Disregarding server certificate errors when this property is either Ignorable or Fatal may result in the loss of privacy or integrity of the content passed over the SSL session.

ServerIntermediateCertificates ServerIntermediateCertificates ServerIntermediateCertificates ServerIntermediateCertificates ServerIntermediateCertificates

Gets the intermediate certificates sent by the server during SSL negotiation when making an SSL connection with a WebSockets server.

public : IVectorView<Certificate> ServerIntermediateCertificates { get; }
IVectorView<Certificate> ServerIntermediateCertificates();
public IReadOnlyList<Certificate> ServerIntermediateCertificates { get; }
Public ReadOnly Property ServerIntermediateCertificates As IReadOnlyList<Certificate>
var iReadOnlyList = messageWebSocketInformation.serverIntermediateCertificates;
Value
IReadOnlyList<Certificate> IReadOnlyList<Certificate> IReadOnlyList<Certificate>

The set of certificates sent by the server during SSL negotiation.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

This property returns the intermediate server certificates used when making an SSL connection with a WebSockets server. These certificates are provided by the server during the SSL connection negotiation. The properties on the Certificate objects in the returned vector can be used to get detailed information on the certificates.

By the time the list of intermediate certificates is available through this property, the SSL connection has already been established. If you wish to inspect the server certificates during the connection process in order to perform custom validation, you should register a handler for the MessageWebSocket.ServerCustomValidationRequested event, and perform your custom server validation in that handler, using the WebSocketServerCustomValidationRequestedEventArgs instance passed to your event handler to inspect the intermediate certificates.

See Also