StreamWebSocket.Control 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得 StreamWebSocket 物件上的 socket 控制資料。
public:
property StreamWebSocketControl ^ Control { StreamWebSocketControl ^ get(); };
StreamWebSocketControl Control();
public StreamWebSocketControl Control { get; }
var streamWebSocketControl = streamWebSocket.control;
Public ReadOnly Property Control As StreamWebSocketControl
屬性值
StreamWebSocket 物件上的 socket 控制資料。
備註
Control 屬性會取得與 StreamWebSocket 物件相關聯的 StreamWebSocketControl 實例。
StreamWebSocketControl 物件會自動以父 StreamWebSocket 物件建立。 接著可以使用 StreamWebSocketControl 實例取得或設定 StreamWebSocket 物件所使用的控制資料。 MessageWebSocketControl 實例上的這些屬性包括以下幾項:
- NoDelay - 一個表示 Nagle 演算法是否被用於 StreamWebSocket 物件的值。
- OutboundBufferSizeInBytes - 用於傳送 StreamWebSocket 物件資料的 send 緩衝區大小(以位元組為單位)。
- ProxyCredential - 用於透過 HTTP 標頭認證,使用 StreamWebSocket 物件向代理伺服器進行認證的憑證。
- ServerCredential - 用於透過 HTTP 標頭認證,使用 StreamWebSocket 物件驗證 WebSocket 伺服器的憑證。
- SupportedProtocols - 獲得一個集合,可用來新增支援子協定清單,並在連線握手時向伺服器公告。
任何對 StreamWebSocketControl 屬性值的變更都必須在連接 StreamWebSocket 前設定好。 因此,如果你需要對 NoDelay、OutboundBufferSizeInBytes、ProxyCredential、ServerCredential 或 SupportedProtocols 屬性做變更,這些變更必須先完成,才能成功呼叫 StreamWebSocket 上的 ConnectAsync 方法。