Ttl Property
Collapse the table of content
Expand the table of content

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.

Community Additions

ADD
Show:
© 2016 Microsoft