StreamSocketInformation 類別

定義

提供 StreamSocket 物件的套接字資訊。

public ref class StreamSocketInformation sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class StreamSocketInformation final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class StreamSocketInformation
Public NotInheritable Class StreamSocketInformation
繼承
Object Platform::Object IInspectable StreamSocketInformation
屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)
應用程式功能
bluetooth.rfcomm ID_CAP_NETWORKING [Windows Phone]

備註

StreamSocketInformation 類別提供 StreamSocket 的相關信息。 這個類別會擷取 StreamSocket 的相關信息,而且可以在 建立 StreamSocket 之後隨時呼叫。

StreamSocketInformation 物件會自動使用父 StreamSocket 物件建立。 StreamSocket.Information 屬性可讓您存取相關聯的 StreamSocketInformation 物件。

屬性

BandwidthStatistics

取得 StreamSocket 對象上網路數據傳輸的頻寬資訊。

請注意,傳回的統計數據是以預設在用戶端版本的 Windows 上啟用的擴充 TCP 統計數據為基礎,但基於 Windows 伺服器版本的效能考慮,預設為停用。 如果無法使用擴充 TCP 統計數據,則所有傳回的數值統計數據都會設定為 0,並將布爾統計數據設定為 false。

LocalAddress

取得與 StreamSocket 對象相關聯的本機 IP 位址。

LocalPort

取得與 StreamSocket 相關聯的 TCP 連接埠號碼。

ProtectionLevel

取得保護層級,表示 StreamSocket 對象上設定的完整性和加密。

RemoteAddress

取得與 StreamSocket 對象相關聯之遠端網路目的地的 IP 位址或主機名。

RemoteHostName

取得與 StreamSocket 對象相關聯之遠端網路目的地的主機名或 IP 位址。

RemotePort

取得與 StreamSocket 對象相關聯之遠端網路目的地的 TCP 連接埠號碼或服務名稱。

RemoteServiceName

取得與 StreamSocket 對象相關聯之遠端網路目的地的服務名稱或 TCP 連接埠號碼。

RoundTripTimeStatistics

取得 StreamSocket 物件的來回時間資訊。

請注意,傳回的統計數據是以預設在用戶端版本的 Windows 上啟用的擴充 TCP 統計數據為基礎,但基於 Windows 伺服器版本的效能考慮,預設為停用。 如果無法使用擴充 TCP 統計數據,則所有傳回的數值統計數據都會設定為 0,並將布爾統計數據設定為 false。

ServerCertificate

使用 StreamSocket 建立 SSL 連線時,從伺服器取得憑證。

ServerCertificateErrors

取得使用 StreamSocket 建立 SSL 連線時所發生的錯誤清單。

ServerCertificateErrorSeverity

取得使用 StreamSocket 建立 SSL 連線時所發生的錯誤類別。

ServerIntermediateCertificates

取得與 StreamSocket 建立 SSL 連線時,伺服器在 SSL 交涉期間所傳送的中繼憑證。

SessionKey

取得位元組陣列,表示由鄰近裝置交換的私人共用秘密。

適用於

另請參閱