public AllowNatTraversal ( bool allowed ) : void | ||
allowed | bool | |
return | void |
using System.Net; using System.Net.Sockets; public void CreateUdpClientWithAllowNatTraversal(bool allowNatTraversal) { var udpClient = new UdpClient(); udpClient.AllowNatTraversal = allowNatTraversal; }Description of Example: This code example demonstrates how to create an instance of UdpClient and set the AllowNatTraversal property to true or false. The method takes a boolean parameter where the user can set the property. Package Library: The System.Net.Sockets class is found within the .NET Framework class library.