StreamWebSocketInformation StreamWebSocketInformation StreamWebSocketInformation StreamWebSocketInformation Class

Provides socket information on a StreamWebSocket object.

Syntax

Declaration

public sealed class StreamWebSocketInformationpublic sealed class StreamWebSocketInformationPublic NotInheritable Class StreamWebSocketInformationpublic sealed class StreamWebSocketInformation

Remarks

StreamWebSocketInformation can be called any time after the StreamWebSocket has been created.

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

Properties summary

Gets bandwidth information for network data transfer on a StreamWebSocket 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.

Gets the IP address associated with a StreamWebSocket object.

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

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

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

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

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

Properties

  • BandwidthStatistics
    BandwidthStatistics
    BandwidthStatistics
    BandwidthStatistics

    Gets bandwidth information for network data transfer on a StreamWebSocket 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; }public BandwidthStatistics BandwidthStatistics { get; }Public ReadOnly Property BandwidthStatistics As BandwidthStatisticspublic BandwidthStatistics BandwidthStatistics { get; }

    Property Value

  • LocalAddress
    LocalAddress
    LocalAddress
    LocalAddress

    Gets the IP address associated with a StreamWebSocket object.

    public HostName LocalAddress { get; }public HostName LocalAddress { get; }Public ReadOnly Property LocalAddress As HostNamepublic HostName LocalAddress { get; }

    Property Value

  • Protocol
    Protocol
    Protocol
    Protocol

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

    public string Protocol { get; }public string Protocol { get; }Public ReadOnly Property Protocol As stringpublic string Protocol { get; }

    Property Value

    • string
      string
      string
      string

      The sub-protocol negotiated with the server during 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 StreamWebSocket is connected, this property is null.

  • ServerCertificate
    ServerCertificate
    ServerCertificate
    ServerCertificate

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

    public Certificate ServerCertificate { get; }public Certificate ServerCertificate { get; }Public ReadOnly Property ServerCertificate As Certificatepublic Certificate ServerCertificate { get; }

    Property Value

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

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

    public IVectorView<ChainValidationResult> ServerCertificateErrors { get; }public IVectorView<ChainValidationResult> ServerCertificateErrors { get; }Public ReadOnly Property ServerCertificateErrors As IVectorView<ChainValidationResult>public IVectorView<ChainValidationResult> ServerCertificateErrors { get; }

    Property Value

    • A list of values describing secure connection errors.

  • ServerCertificateErrorSeverity
    ServerCertificateErrorSeverity
    ServerCertificateErrorSeverity
    ServerCertificateErrorSeverity

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

    public SocketSslErrorSeverity ServerCertificateErrorSeverity { get; }public SocketSslErrorSeverity ServerCertificateErrorSeverity { get; }Public ReadOnly Property ServerCertificateErrorSeverity As SocketSslErrorSeveritypublic SocketSslErrorSeverity ServerCertificateErrorSeverity { get; }

    Property Value

    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

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

    public IVectorView<Certificate> ServerIntermediateCertificates { get; }public IVectorView<Certificate> ServerIntermediateCertificates { get; }Public ReadOnly Property ServerIntermediateCertificates As IVectorView<Certificate>public IVectorView<Certificate> ServerIntermediateCertificates { get; }

    Property Value

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

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

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Capabilities

privateNetworkClientServer
internetClient

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute

Details

Assembly

Windows.Networking.Sockets.dll