語言

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

規格需求 Description
裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)
應用程式功能
bluetooth.rfcomm

備註

StreamSocketInformation 類別提供有關 StreamSocket 的資訊。 此類別會擷取 StreamSocket 上的資訊,並在 StreamSocket 建立後隨時被呼叫。

StreamSocketInformation 物件會自動用父 StreamSocket 物件建立。 StreamSocket.Information 屬性提供對應的 StreamSocketInformation 物件存取。

屬性

名稱 Description
BandwidthStatistics

透過 StreamSocket 物件取得網路資料傳輸的頻寬資訊。

請注意,回傳的統計數據是基於擴充 TCP 統計,該統計在 Windows 用戶端版本預設啟用,但在 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 物件的往返時間資訊。

請注意,回傳的統計數據是基於擴充 TCP 統計,該統計在 Windows 用戶端版本預設啟用,但在 Windows 伺服器版本因效能考量預設關閉。 若無法提供擴充的 TCP 統計資料,則所有回傳的數值統計資料皆設為 0,布林統計則設為 false。

ServerCertificate

透過 StreamSocket 進行 SSL 連線時,會從伺服器取得憑證。

ServerCertificateErrors

會取得與 StreamSocket 建立 SSL 連線時發生的錯誤清單。

ServerCertificateErrorSeverity

會取得與 StreamSocket 建立 SSL 連線時發生的錯誤類別。

ServerIntermediateCertificates

在與 StreamSocket 進行 SSL 連線時,接收伺服器在 SSL 協商時傳送的中介憑證。

SessionKey

取得一個位元組陣列,代表近距離裝置交換的私密共享秘密。

適用於

另請參閱