StreamSocketInformation StreamSocketInformation StreamSocketInformation StreamSocketInformation Class

Provides socket information on a StreamSocket object.

Syntax

Declaration

public sealed class StreamSocketInformationpublic sealed class StreamSocketInformationPublic NotInheritable Class StreamSocketInformationpublic sealed class StreamSocketInformation

Remarks

The DatagramSocketInformation class provides information about a StreamSocket. This class retrieves information on a StreamSocket and can be called any time after the StreamSocket has been created.

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

Properties summary

Gets bandwidth information for network data transfer on a StreamSocket 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 local IP address associated with a StreamSocket object.

Get the TCP port number associated with a StreamSocket.

Gets the protection level that represents the integrity and encryption set on a StreamSocket object.

Get the IP address or hostname of the remote network destination associated with a StreamSocket object.

Get the hostname or IP address of the remote network destination associated with a StreamSocket object.

Get the TCP port number or service name of the remote network destination associated with a StreamSocket object.

Get the service name or TCP port number of the remote network destination associated with a StreamSocket object.

Gets round trip time information for a StreamSocket 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 certificate from the server when making an SSL connection with a StreamSocket.

Gets the list of errors that occurred making an SSL connection with a StreamSocket.

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

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

Get a byte array that represents the private shared secret exchanged by proximity devices.

Properties

  • BandwidthStatistics
    BandwidthStatistics
    BandwidthStatistics
    BandwidthStatistics

    Gets bandwidth information for network data transfer on a StreamSocket 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 local IP address associated with a StreamSocket object.

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

    Property Value

    Remarks

    The LocalAddress property represents the local IP address the StreamSocket object is bound to after a connection is established.

    An app can set the local hostname or IP address to use by calling the ConnectAsync(EndpointPair) or ConnectAsync(EndpointPair, SocketProtectionLevel) method on the StreamSocket. The connect operation will bind the socket to the specific local IP address and local UDP port number. After the bind or connect operation completes, the LocalAddress property contains the IP address and the LocalPort property contains the local TCP port number that the local hostname and service name resolved to.

    If the local hostname or IP address passed to the ConnectAsync(EndpointPair) or ConnectAsync(EndpointPair, SocketProtectionLevel) method is null or the ConnectAsync(HostName, String) or ConnectAsync(HostName, String, SocketProtectionLevel) method is called, the system will determine the local IP address to bind to the StreamSocket object.

  • LocalPort
    LocalPort
    LocalPort
    LocalPort

    Get the TCP port number associated with a StreamSocket.

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

    Property Value

    • string
      string
      string
      string

      The local TCP port number of service name.

    Remarks

    The LocalPort property represents the local TCP port number the StreamSocket object is bound to after a connection is established.

    An app can set the local service name or TCP port number to use by calling the ConnectAsync(EndpointPair) or ConnectAsync(EndpointPair, SocketProtectionLevel) method on the StreamSocket. The connect operation will bind the socket to the specific local IP address and local UDP port number. After the bind or connect operation completes, the LocalPort property contains the IP address and the LocalPort property contains the local TCP port number that the local hostname and service name resolved to.

    If the local service name or TCP port number passed to the ConnectAsync(EndpointPair) or ConnectAsync(EndpointPair, SocketProtectionLevel) method is an empty string or the ConnectAsync(HostName, String) or ConnectAsync(HostName, String, SocketProtectionLevel) method is called, the system will determine the local TCP port number to bind to the StreamSocket object.

  • ProtectionLevel
    ProtectionLevel
    ProtectionLevel
    ProtectionLevel

    Gets the protection level that represents the integrity and encryption set on a StreamSocket object.

    public SocketProtectionLevel ProtectionLevel { get; }public SocketProtectionLevel ProtectionLevel { get; }Public ReadOnly Property ProtectionLevel As SocketProtectionLevelpublic SocketProtectionLevel ProtectionLevel { get; }

    Property Value

  • RemoteAddress
    RemoteAddress
    RemoteAddress
    RemoteAddress

    Get the IP address or hostname of the remote network destination associated with a StreamSocket object.

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

    Property Value

    Remarks

    The RemoteHostName property represents the remote hostname or IP address for the remote network destination associated with a StreamSocket object. The RemoteServiceName property represents the remote service name or TCP port number for the remote network destination associated with a StreamSocket object. The RemoteHostName and RemoteServiceName properties are passed to the ConnectAsync(EndpointPair) method on the StreamSocket to establish a connection.

    After a connection is established, the RemoteAddress property contains the IP address and the RemotePort property contains the TCP port number of the remote endpoint for the socket connection. Before a connection is established, the RemoteAddress property is null and the RemotePort property contains an empty string.

  • RemoteHostName
    RemoteHostName
    RemoteHostName
    RemoteHostName

    Get the hostname or IP address of the remote network destination associated with a StreamSocket object.

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

    Property Value

    Remarks

    The RemoteHostName property represents the remote hostname or IP address for the remote network destination associated with a StreamSocket object. The remote hostname or IP address that a StreamSocket object connects to is passed in the remoteHostName parameter to the ConnectAsync(EndpointPair) method on the StreamSocket.

    The RemoteHostName property can be one of the following:

    • The name of the local host that can be resolved by the Domain Name System (DNS) or by another namespace provider.
    • The name of the local host that matches a string in the following file on the local computer: %WINDIR%\system32\drivers\etc\hosts.
    • A string that contains an IPv4 or an IPv6 network address of the local host. An IPv4 address string is in dotted-decimal notation ("192.168.1.111", for example). An IPv6 address is in hexadecimal notation ("21DA:00D3:0010:2F3B:02AA:00FF:FE28:9C5A", for example). When this property is the "localhost" string, this represents all loopback addresses on the local computer.

    The RemoteServiceName property represents the remote service name or TCP port number for the remote network destination associated with a StreamSocket object.

    After a connection is established, the RemoteAddress property contains the IP address and the RemotePort property contains the TCP port number of the remote endpoint for the socket connection.

  • RemotePort
    RemotePort
    RemotePort
    RemotePort

    Get the TCP port number or service name of the remote network destination associated with a StreamSocket object.

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

    Property Value

    • string
      string
      string
      string

      The TCP port number of the remote network endpoint after a connection is established.

    Remarks

    The RemoteHostName property represents the remote hostname or IP address for the remote network destination associated with a StreamSocket object. The RemoteServiceName property represents the remote service name or TCP port number for the remote network destination associated with a StreamSocket object. The RemoteHostName and RemoteServiceName properties are passed to the ConnectAsync(EndpointPair) method on the StreamSocket to establish a connection.

    After a connection is established, the RemoteAddress property contains the IP address and the RemotePort property contains the TCP port number of the remote endpoint for the socket connection. Before a connection is established, the RemoteAddress property is null and the RemotePort property contains an empty string.

  • RemoteServiceName
    RemoteServiceName
    RemoteServiceName
    RemoteServiceName

    Get the service name or TCP port number of the remote network destination associated with a StreamSocket object.

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

    Property Value

    • string
      string
      string
      string

      The service name or TCP port number of the remote network destination.

    Remarks

    The RemoteServiceName property represents the remote service name or TCP port number for the remote network destination associated with a StreamSocket object. The remote service name or TCP port that a StreamSocket object connects to is passed in the remoteServiceName parameter to the ConnectAsync(EndpointPair) method on the StreamSocket.

    The RemoteServiceName property can be one of the following:

    • A numeric literal for a TCP port number (80 for the TCP port typically used for the HTTP protocol, for example).
    • A string alias for a port number ("http", for example) that matches a string in the following file on the local computer: %WINDIR%\system32\drivers\etc\services
    • A service name that can be resolved by a namespace provider using a SRV record. The RemoteHostName property represents the remote service name or TCP port number for the remote network destination associated with a StreamSocket object.

    After a connection is established, the RemoteAddress property contains the IP address and the RemotePort property contains the TCP port number of the remote endpoint for the socket connection.

  • RoundTripTimeStatistics
    RoundTripTimeStatistics
    RoundTripTimeStatistics
    RoundTripTimeStatistics

    Gets round trip time information for a StreamSocket 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 RoundTripTimeStatistics RoundTripTimeStatistics { get; }public RoundTripTimeStatistics RoundTripTimeStatistics { get; }Public ReadOnly Property RoundTripTimeStatistics As RoundTripTimeStatisticspublic RoundTripTimeStatistics RoundTripTimeStatistics { get; }

    Property Value

  • ServerCertificate
    ServerCertificate
    ServerCertificate
    ServerCertificate

    Gets the certificate from the server when making an SSL connection with a StreamSocket.

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

    Property Value

    Remarks

    This property gets the server certificate used for an SSL connection when connecting with a StreamSocket. This certificate is provided by the server during the SSL connection negotiation. The properties on the Certificate object returned can be used to get detailed information on the certificate.

    This property is useful for notifying the user why an SSL connection failed.

    This property can also be used to enforce stronger security than the default connection using the Certificate object returned. The BuildChainAsync(IIterable<Certificate>, ChainBuildingParameters) methods and other properties on the Certificate object and methods on the CertificateChain object can be used when an app needs stronger security than the standard SSL negotiation.

  • ServerCertificateErrors
    ServerCertificateErrors
    ServerCertificateErrors
    ServerCertificateErrors

    Gets the list of errors that occurred making an SSL connection with a StreamSocket.

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

    Property Value

    • The list of errors that occurred making an SSL connection.

    Remarks

    The ServerCertificateErrors property gets a vector of ChainValidationResult enumeration values of errors that occurred making an SSL connection with a StreamSocket.

    SSL server certificate errors should only be ignored in advanced scenarios. Disregarding server certificate errors may result in the loss of privacy or integrity of the content passed over the SSL session.

  • ServerCertificateErrorSeverity
    ServerCertificateErrorSeverity
    ServerCertificateErrorSeverity
    ServerCertificateErrorSeverity

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

    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 the ServerCertificateErrorSeverity 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 StreamSocket.

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

    This property can also be used to enforce stronger security than the default connection using the Certificate objects returned. The BuildChainAsync(IIterable<Certificate>, ChainBuildingParameters) methods and other properties on the Certificate objects and methods on the CertificateChain object can be used when an app needs stronger security than the standard SSL negotiation.

  • SessionKey
    SessionKey
    SessionKey
    SessionKey

    Get a byte array that represents the private shared secret exchanged by proximity devices.

    public IBuffer SessionKey { get; }public IBuffer SessionKey { get; }Public ReadOnly Property SessionKey As IBufferpublic IBuffer SessionKey { get; }

    Property Value

    Remarks

    The SessionKey property is only used with a StreamSocket object created by proximity devices when initiated by tapping. The SessionKey property for a tapping device may contain an array with a private shared secret. A private shared secret is not required by a tapping device, so this property can be null.

    For proximity devices initiated by tapping, the SessionKey property can be passed to Crypto runtime classes to handle encryption. For more information, see Supporting proximity and tapping, the SymmetricKeyAlgorithmProvider class, and related classes.

    For other StreamSocket objects not initiated by tapping, the SessionKey property is always null.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Capabilities

bluetooth.rfcomm
ID_CAP_NETWORKING [Windows Phone]

Attributes

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

Details

Assembly

Windows.Networking.Sockets.dll