This topic has not yet been rated - Rate this topic

UdpClient.Ttl Property

Gets or sets a value that specifies the Time to Live (TTL) value of Internet Protocol (IP) packets sent by the UdpClient.

Namespace:  System.Net.Sockets
Assembly:  System (in System.dll)
public short Ttl { get; set; }

Property Value

Type: System.Int16
The TTL value.

The TTL value indicates the maximum number of routers a packet can traverse before the router discards the packet and an Internet Control Message Protocol (ICMP) "TTL exceeded" error message is returned to the sender.

The following code example shows the use of the Ttl property.


public static void GetSetTtl(UdpClient u)
{
    // Set the Time To Live (TTL) for this client.
    u.Ttl = 42;
    Console.WriteLine("Ttl value is {0}",
        u.Ttl);
}


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ