UPnPNAT upnpnat = new UPnPNAT(); Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); IPAddress ipAddress = null; IPEndPoint Addr = null; NATUPNPLib.IStaticPortMappingCollection mappings = upnpnat.StaticPortMappingCollection; mappings.Add(20131, "TCP", 20131, "46.175.163.14", true, "Test Open Port"); Addr = new IPEndPoint(IPAddress.Parse("192.168.0.111"), 20131); //"localhost" = 127.0.0.1 s.Bind(Addr); s.Listen(10);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)