MtuDiscoveryOptions
Describes options for MTU discovery.
using System;
using System.Net.NetworkInformation;
namespace DotNext.Net.NetworkInformation
{
public class MtuDiscoveryOptions : PingOptions
{
private const int DefaultMinMtuSize = 60;
private const int DefaultMaxMtuSize = 65500;
private int minMtuSize;
private int maxMtuSize;
public int MinMtuSize {
get {
return minMtuSize;
}
set {
if (value <= 0)
throw new ArgumentOutOfRangeException("value");
minMtuSize = value;
}
}
public int MaxMtuSize {
get {
return maxMtuSize;
}
set {
if (value > 65500)
throw new ArgumentOutOfRangeException("value");
maxMtuSize = value;
}
}
public MtuDiscoveryOptions(byte ttl = 64, int minMtuSize = 60, int maxMtuSize = 65500)
{
if (minMtuSize <= 0)
throw new ArgumentOutOfRangeException("minMtuSize");
this.minMtuSize = minMtuSize;
if (maxMtuSize > 65500)
throw new ArgumentOutOfRangeException("maxMtuSize");
this.maxMtuSize = maxMtuSize;
base..ctor(ttl, true);
}
}
}