Stream​Socket​Information Stream​Socket​Information Stream​Socket​Information Class

Definition

Provides socket information on a StreamSocket object.

public : sealed class StreamSocketInformation : IStreamSocketInformation, IStreamSocketInformation2public sealed class StreamSocketInformation : IStreamSocketInformation, IStreamSocketInformation2Public NotInheritable Class StreamSocketInformation Implements IStreamSocketInformation, IStreamSocketInformation2
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
bluetooth.rfcomm ID_CAP_NETWORKING [Windows Phone]

Remarks

The StreamSocketInformation 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 StreamSocketInformation object is automatically created with the parent StreamSocket object. The StreamSocket.Information property provides access to the associated StreamSocketInformation object.

Properties

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

Bandwidth information for network data transfer on a StreamSocket object.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
ID_CAP_NETWORKING [Windows Phone]
See Also

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

The local IP address or hostname.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
ID_CAP_NETWORKING [Windows Phone]

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.

See Also

LocalPort LocalPort LocalPort

Get the TCP port number associated with a StreamSocket.

public : PlatForm::String LocalPort { get; }public string LocalPort { get; }Public ReadOnly Property LocalPort As string
Value
string string string

The local TCP port number of service name.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
ID_CAP_NETWORKING [Windows Phone]

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.

See Also

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

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

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
ID_CAP_NETWORKING [Windows Phone]
See Also

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

The IP address of the remote network endpoint after a connection is established.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
ID_CAP_NETWORKING [Windows Phone]

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

See Also

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

The hostname or IP address of the remote network destination.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
ID_CAP_NETWORKING [Windows Phone]

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

See Also

RemotePort RemotePort RemotePort

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

public : PlatForm::String RemotePort { get; }public string RemotePort { get; }Public ReadOnly Property RemotePort As string
Value
string string string

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

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
ID_CAP_NETWORKING [Windows Phone]

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

See Also

RemoteServiceName RemoteServiceName RemoteServiceName

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

public : PlatForm::String RemoteServiceName { get; }public string RemoteServiceName { get; }Public ReadOnly Property RemoteServiceName As string
Value
string string string

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

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
ID_CAP_NETWORKING [Windows Phone]

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

See Also

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 RoundTripTimeStatistics
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
ID_CAP_NETWORKING [Windows Phone]
See Also

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

The certificate from the server with the SSL information.

Attributes

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

See Also

ServerCertificateErrors ServerCertificateErrors ServerCertificateErrors

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

public : IVectorView<ChainValidationResult> ServerCertificateErrors { get; }public IReadOnlyList<ChainValidationResult> ServerCertificateErrors { get; }Public ReadOnly Property ServerCertificateErrors As IReadOnlyList<ChainValidationResult>
Value
Windows.Foundation.Collections.IVectorView<Windows.Security.Cryptography.Certificates.ChainValidationResult> Windows.Foundation.Collections.IVectorView<Windows.Security.Cryptography.Certificates.ChainValidationResult> Windows.Foundation.Collections.IVectorView<Windows.Security.Cryptography.Certificates.ChainValidationResult>

The list of errors that occurred making an SSL connection.

Attributes

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.

See Also

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

The category of error on an SSL connection.

Attributes

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.

See Also

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 IReadOnlyList<Certificate> ServerIntermediateCertificates { get; }Public ReadOnly Property ServerIntermediateCertificates As IReadOnlyList<Certificate>
Value
Windows.Foundation.Collections.IVectorView<Windows.Security.Cryptography.Certificates.Certificate> Windows.Foundation.Collections.IVectorView<Windows.Security.Cryptography.Certificates.Certificate> Windows.Foundation.Collections.IVectorView<Windows.Security.Cryptography.Certificates.Certificate>

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

Attributes

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

See Also

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

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

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
ID_CAP_NETWORKING [Windows Phone]

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 Windows.Security.Cryptography.Core.SymmetricKeyAlgorithmProvider class, and related classes.

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

See Also

See Also