Uređivanje

Dijeli putem


UdpClient.AllowNatTraversal(Boolean) Method

Definition

Enables or disables Network Address Translation (NAT) traversal on a UdpClient instance.

public:
 void AllowNatTraversal(bool allowed);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public void AllowNatTraversal (bool allowed);
public void AllowNatTraversal (bool allowed);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
member this.AllowNatTraversal : bool -> unit
member this.AllowNatTraversal : bool -> unit
Public Sub AllowNatTraversal (allowed As Boolean)

Parameters

allowed
Boolean

A Boolean value that specifies whether to enable or disable NAT traversal.

Attributes

Remarks

The AllowNatTraversal method is used to enable or disable NAT traversal for a UdpClient instance. NAT traversal may be provided using Teredo, 6to4, or an ISATAP tunnel.

When the allowed parameter is false, the IPProtectionLevel option on the associated socket is set to EdgeRestricted. This explicitly disables NAT traversal for a UdpClient instance.

When the allowed parameter is true, the IPProtectionLevel option on the associated socket is set to Unrestricted. This may allow NAT traversal for a UdpClient depending on firewall rules in place on the system.

A Teredo address is an IPv6 address with the prefix of 2001::/32. Teredo addresses can be returned through normal DNS name resolution or enumerated as an IPv6 address assigned to a local interface.

Applies to

See also