语言

DatagramSocket.Control 属性

定义

获取 DatagramSocket 对象的套接字控制数据。

public:
 property DatagramSocketControl ^ Control { DatagramSocketControl ^ get(); };
DatagramSocketControl Control();
public DatagramSocketControl Control { get; }
var datagramSocketControl = datagramSocket.control;
Public ReadOnly Property Control As DatagramSocketControl

属性值

DatagramSocket 对象上的套接字控制数据。

注解

Control 属性获取与 DatagramSocket 对象关联的 DatagramSocketControl 实例。 DatagramSocketControl 对象是使用父 DatagramSocket 对象自动创建的。 然后, DatagramSocketControl 实例可用于获取或设置 DatagramSocket 使用的控件数据。 DatagramSocketControl 实例上的这些属性包括:

可以在 DatagramSocket 绑定或连接之前或之后设置 OutboundUnicastHopLimit 属性。 在绑定或连接的 DatagramSocket 上更改此值之前,应首先刷新任何传出数据包,以确保使用以前的跃点限制发送所有以前写入的数据。

在 DatagramSocket 绑定或连接之前,必须设置对 DatagramSocketControl 上其他属性值所做的任何更改。 因此,如果需要更改 DontFragment、InboundBufferSizeInBytes 或 QualityOfService 属性,则必须在成功调用 BindEndpointAsync、BindServiceNameAsync 或 DatagramSocket 上的 ConnectAsync 方法之前进行这些更改。

适用于

另请参阅