コード例 #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}");
 }
コード例 #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();
 }
コード例 #3
0
ファイル: UniP2PManager.cs プロジェクト: kitsunetohu/TomoPlay
 public static void Init()
 {
     RandomMyPeerID();
     Socket.Init();
     GetPrivateIPEndPoint();
     if (AdvancedSettings.isSTUN)
     {
         StunIPEndPoint  = Socket.GetSTUNResult();
         isGetStunResult = true;
     }
     ManagersInit();
     isInit = true;
     Debugger.Log("[UniP2PManager] Initialized");
 }
コード例 #4
0
 public ServerCenter(int port)
 {
     socket.Init(port);
 }