DatagramSocketControl.DontFragment DatagramSocketControl.DontFragment DatagramSocketControl.DontFragment DatagramSocketControl.DontFragment DatagramSocketControl.DontFragment Property

Definition

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

public : Platform::Boolean DontFragment { get; set; }
bool DontFragment();

void DontFragment(bool dontfragment);
public bool DontFragment { get; set; }
Public ReadWrite Property DontFragment As bool
var bool = datagramSocketControl.dontFragment;
datagramSocketControl.dontFragment = bool;

Property Value

bool bool bool

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.

See also