DatagramSocket.Control Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets socket control data on a DatagramSocket object.
public:
property DatagramSocketControl ^ Control { DatagramSocketControl ^ get(); };
DatagramSocketControl Control();
public DatagramSocketControl Control { get; }
var datagramSocketControl = datagramSocket.control;
Public ReadOnly Property Control As DatagramSocketControl
Property Value
Socket control data on a DatagramSocket object.
Windows requirements
App capabilities |
ID_CAP_NETWORKING [Windows Phone]
|
Remarks
The Control property gets the DatagramSocketControl instance associated with a DatagramSocket object. A DatagramSocketControl object is automatically created with the parent DatagramSocket object. The DatagramSocketControl instance can then be used to get or set control data used by the DatagramSocket. These properties on the DatagramSocketControl instance include the following:
- DontFragment - Gets or sets a Boolean value that specifies whether the DatagramSocket allows IP datagrams for UDP to be fragmented.
- InboundBufferSizeInBytes - Gets or sets the size, in bytes, of the buffer used for receiving data on the DatagramSocket object.
- OutboundUnicastHopLimit - Gets or sets the hop limit on an outbound packet sent to a unicast IP address by the DatagramSocket object.
- QualityOfService - Gets or sets the quality of service on a DatagramSocket object.
The OutboundUnicastHopLimit property can be set before or after the DatagramSocket is bound or connected. Before changing this value on a bound or connected DatagramSocket, any outgoing packets should first be flushed to ensure that all previously-written data is sent out with the previous hop limit.
Any changes to the other property values on the DatagramSocketControl must be set before the DatagramSocket is bound or connected. As a result if you need to make changes to the DontFragment, InboundBufferSizeInBytes, or QualityOfService properties, then these changes must occur before a successful call to the BindEndpointAsync, BindServiceNameAsync, or one of the ConnectAsync methods on the DatagramSocket.