StreamSocket.Control 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得 StreamSocket 物件上的 socket 控制資料。
public:
property StreamSocketControl ^ Control { StreamSocketControl ^ get(); };
StreamSocketControl Control();
public StreamSocketControl Control { get; }
var streamSocketControl = streamSocket.control;
Public ReadOnly Property Control As StreamSocketControl
屬性值
StreamSocket 物件上的 socket 控制資料。
備註
Control 屬性會取得與 StreamSocket 物件相關的 StreamSocketControl 實例。
StreamSocketControl 物件會自動建立,使用父 StreamSocket 物件。 接著可以使用 StreamSocketControl 實例來取得或設定 StreamSocket 物件所使用的控制資料。 StreamSocketControl 實例上的這些屬性包括以下幾項:
- IgnorableServerCertificateErrors - 在與 StreamSocket 物件建立 SSL 連線時,取得一個可忽略的 SSL 伺服器錯誤向量。
- KeepAlive - 表示 Keep-Alive 封包是否被傳送至 StreamSocket 物件的遠端目的地的值。
- NoDelay - 一個表示 Nagle 演算法是否被用於 StreamSocket 物件的值。
- OutboundUnicastHopLimit - StreamSocket 物件傳送到單播 IP 位址的外站封包的跳躍限制。
- OutboundBufferSizeInBytes - 用於傳送 StreamSocket 物件資料的 send 緩衝區大小(以位元組為單位)。
- 服務品質(QualityOfService )-針對 StreamSocket 物件的服務品質。
對於 StreamSocketControl 屬性值的任何變更,都必須在連接 StreamSocket 前設定。 因此,如果你需要對 IgnorableServerCertificateErrors、KeepAlive、NoDelay、OutboundBufferSizeInBytes、OutboundUnicastHopLimit 或 QualityOfService 屬性做變更,這些變更必須在成功呼叫 StreamSocket 上的 ConnectAsync 方法之前完成。