Show / Hide Table of Contents

Class MtuDiscovery

Allows to discover maximum size of Message Transfer Unit over IP network.

Inheritance
object
MarshalByRefObject
Component
Ping
MtuDiscovery
Implements
IComponent
IDisposable
Inherited Members
Ping.Dispose(bool)
Ping.OnPingCompleted(PingCompletedEventArgs)
Ping.Send(IPAddress)
Ping.Send(IPAddress, int)
Ping.Send(IPAddress, int, byte[])
Ping.Send(IPAddress, int, byte[], PingOptions)
Ping.Send(string)
Ping.Send(string, int)
Ping.Send(string, int, byte[])
Ping.Send(string, int, byte[], PingOptions)
Ping.Send(IPAddress, TimeSpan, byte[], PingOptions)
Ping.Send(string, TimeSpan, byte[], PingOptions)
Ping.SendAsync(IPAddress, int, byte[], PingOptions, object)
Ping.SendAsync(IPAddress, int, byte[], object)
Ping.SendAsync(IPAddress, int, object)
Ping.SendAsync(IPAddress, object)
Ping.SendAsync(string, int, byte[], PingOptions, object)
Ping.SendAsync(string, int, byte[], object)
Ping.SendAsync(string, int, object)
Ping.SendAsync(string, object)
Ping.SendAsyncCancel()
Ping.SendPingAsync(IPAddress)
Ping.SendPingAsync(IPAddress, int)
Ping.SendPingAsync(IPAddress, int, byte[])
Ping.SendPingAsync(IPAddress, int, byte[], PingOptions)
Ping.SendPingAsync(IPAddress, TimeSpan, byte[], PingOptions, CancellationToken)
Ping.SendPingAsync(string)
Ping.SendPingAsync(string, int)
Ping.SendPingAsync(string, int, byte[])
Ping.SendPingAsync(string, int, byte[], PingOptions)
Ping.SendPingAsync(string, TimeSpan, byte[], PingOptions, CancellationToken)
Ping.PingCompleted
Component.Dispose()
Component.GetService(Type)
Component.ToString()
Component.CanRaiseEvents
Component.Container
Component.DesignMode
Component.Events
Component.Site
Component.Disposed
MarshalByRefObject.GetLifetimeService()
MarshalByRefObject.InitializeLifetimeService()
MarshalByRefObject.MemberwiseClone(bool)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: DotNext.Net.NetworkInformation
Assembly: DotNext.dll
Syntax
public class MtuDiscovery : Ping, IComponent, IDisposable
Remarks

The discovered MTU size doesn't include size of IPv4 or IPv6 headers.

Methods

| Edit this page View Source

Discover(IPAddress, int, MtuDiscoveryOptions, CancellationToken)

Discovers maximum allowed MTU size by the underlying network.

Declaration
public int? Discover(IPAddress address, int timeout, MtuDiscoveryOptions options, CancellationToken token = default)
Parameters
Type Name Description
IPAddress address

The destination host to which the MTU size should be discovered.

int timeout

The maximum number of milliseconds to wait for the ICMP echo reply message. It's not a time-out of entire operation.

MtuDiscoveryOptions options

Discovery options.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
int?

The discovered MTU size, in bytes; or null if remote host is not reachable.

Exceptions
Type Condition
ArgumentOutOfRangeException

timeout is less than 0.

InvalidOperationException

Discovery is in progress.

PingException

An exception was thrown while sending or receiving the ICMP messages.

SocketException

address is not a valid address.

ObjectDisposedException

The object has been disposed.

OperationCanceledException

The operation has been canceled.

| Edit this page View Source

DiscoverAsync(IPAddress, int, MtuDiscoveryOptions, CancellationToken)

Discovers maximum allowed MTU size by the underlying network.

Declaration
public Task<int?> DiscoverAsync(IPAddress address, int timeout, MtuDiscoveryOptions options, CancellationToken token = default)
Parameters
Type Name Description
IPAddress address

The destination host to which the MTU size should be discovered.

int timeout

The maximum number of milliseconds to wait for the ICMP echo reply message. It's not a time-out of entire operation.

MtuDiscoveryOptions options

Discovery options.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
Task<int?>

The discovered MTU size, in bytes; or null if remote host is not reachable.

Exceptions
Type Condition
ArgumentOutOfRangeException

timeout is less than 0.

InvalidOperationException

Discovery is in progress.

PingException

An exception was thrown while sending or receiving the ICMP messages.

SocketException

address is not a valid address.

ObjectDisposedException

The object has been disposed.

OperationCanceledException

The operation has been canceled.

Implements

IComponent
IDisposable

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.GetUserData<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, ReadOnlySpan<T>)
ExpressionBuilder.Const<T>(T)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan, CancellationToken)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾