Skip to main content
DatagramSocketControl.DontFragment | dontFragment property

Gets or sets a Boolean value that specifies whether the DatagramSocket allows IP datagrams for UDP to be fragmented.

Syntax


var dontFragment = datagramSocketControl.dontFragment;
datagramSocketControl.dontFragment = dontFragment;

public bool DontFragment { get; set; }

Public Property DontFragment As Boolean

public:
property bool DontFragment { 
   bool get();
   void set (bool value);
}

Property value

Type: Boolean [JavaScript] | System.Boolean [.NET] | Platform::Boolean [C++]

Whether the DatagramSocket allows datagrams to be fragmented.

true if the DatagramSocket shouldn't fragment datagrams; otherwise, false. The default is false which allows datagrams to be fragmented.

Remarks

The DontFragment property lets your app decide whether the DatagramSocket allows datagrams to be fragmented. The default value is false which allows datagrams to be fragmented.

IP datagrams used by UDP require fragmentation when their size exceeds the Maximum Transfer Unit (MTU) of the network transmission hardware. Datagrams may be fragmented by the sending app or by an intermediate router (IPv4 only). If a datagram must be fragmented, and the DontFragment property is set to true, the datagram is discarded, and an Internet Control Message Protocol (ICMP) error message is sent back to the sender of the datagram.

This property may be set before the DatagramSocket is bound or connected. After the DatagramSocket is bound or connected, setting this property will result in an error.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.winmd

See also

Other resources
How to use advanced socket controls (HTML)
How to use advanced socket controls (XAML)
Reference
DatagramSocket
DatagramSocketControl