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}"); }
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(); }
public static void Init() { RandomMyPeerID(); Socket.Init(); GetPrivateIPEndPoint(); if (AdvancedSettings.isSTUN) { StunIPEndPoint = Socket.GetSTUNResult(); isGetStunResult = true; } ManagersInit(); isInit = true; Debugger.Log("[UniP2PManager] Initialized"); }
public ServerCenter(int port) { socket.Init(port); }