DatagramSocket.Control 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得 DatagramSocket 物件上的 socket 控制資料。
public:
property DatagramSocketControl ^ Control { DatagramSocketControl ^ get(); };
DatagramSocketControl Control();
public DatagramSocketControl Control { get; }
var datagramSocketControl = datagramSocket.control;
Public ReadOnly Property Control As DatagramSocketControl
屬性值
DatagramSocket 物件上的 socket 控制資料。
備註
Control 屬性會取得與 DatagramSocket 物件相關聯的 DatagramSocketControl 實例。 DatagramSocketControl 物件會自動建立,使用父 DatagramSocket 物件。 DatagramSocketControl 實例可用於取得或設定 DatagramSocket 使用的控制資料。 DatagramSocketControl 實例上的這些屬性包括以下幾項:
- DontFragment - 取得或設定一個 布林 值,指定 DatagramSocket 是否允許 UDP 的 IP 資料報被分割。
- InboundBufferSizeInBytes - 取得或設定用於接收 資料 的緩衝區大小(位元組)。
- OutboundUnicastHopLimit - 接收或設定由 DatagramSocket 物件發送到單播 IP 位址的外發封包的跳躍限制。
- QualityOfService - 取得或設定 DatagramSocket 物件的服務品質。
OutboundUnicastHopLimit 屬性可以在 DatagramSocket 綁定或連接之前或之後設定。 在更改綁定或連接資料 報套接字的此值前,應先清除任何發出封包,以確保所有先前寫入的資料都以先前的跳數限制發送。
DatagramSocketControl 上其他屬性值的任何變更都必須在綁定或連接 DatagramSocket 之前設定。 因此,如果你需要對 DontFragment、InboundBufferSizeInBytes 或 QualityOfService 屬性做變更,這些變更必須在成功呼叫 BindEndpointAsync、BindServiceNameAsync 或 DatagramSocket 上的 ConnectAsync 方法之前完成。