Example #1
0
 void init()
 {
     //socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
     socket.Init(0);
     id2client = new Dictionary <int, IRemote>();
     client2id = new Dictionary <IRemote, int>();
     Console.WriteLine($"route start at port {port}");
 }
Example #2
0
 public void Start(string remoteIP, int remotePort, string gameIP, int gamePort)
 {
     /*gameEnd = new IPEndPoint(IPAddress.Parse(gameIP), gamePort);
      * remoteEnd = new IPEndPoint(IPAddress.Parse(remoteIP), remotePort);
      * socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);*/
     socket.Init();
     //localEnd = new IPEndPoint(IPAddress.Parse(gameIP), (socket.LocalEndPoint as IPEndPoint).Port);
     //Console.WriteLine("LocalServer::" + localEnd);
     Tick();
     Connect(gamePort);
     ClearUnuseClient();
     Recv();
 }
Example #3
0
 public static void Init()
 {
     RandomMyPeerID();
     Socket.Init();
     GetPrivateIPEndPoint();
     if (AdvancedSettings.isSTUN)
     {
         StunIPEndPoint  = Socket.GetSTUNResult();
         isGetStunResult = true;
     }
     ManagersInit();
     isInit = true;
     Debugger.Log("[UniP2PManager] Initialized");
 }
Example #4
0
 public ServerCenter(int port)
 {
     socket.Init(port);
 }