1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-16 07:06:30 +09:00

UPnP support added: get external ip, add forwarding rule and delete forwarding rule

This commit is contained in:
lidgren
2011-04-27 20:52:29 +00:00
parent b575f72186
commit 713d91ac58
7 changed files with 353 additions and 112 deletions

View File

@@ -1,6 +1,8 @@
using System;
using System.Reflection;
using Lidgren.Network;
using System.Net;
using System.Net.Sockets;
namespace UnitTests
{
@@ -9,11 +11,10 @@ namespace UnitTests
static void Main(string[] args)
{
NetPeerConfiguration config = new NetPeerConfiguration("unittests");
config.EnableUPnP = true;
NetPeer peer = new NetPeer(config);
peer.Start(); // needed for initialization
System.Threading.Thread.Sleep(50);
Console.WriteLine("Unique identifier is " + NetUtility.ToHexString(peer.UniqueIdentifier));
ReadWriteTests.Run(peer);