Exemplo n.º 1
0
 public override void SetUp()
 {
     base.SetUp();
     localIP  = GameTool.GetLocalIP();
     userName = localIP;
     Debug.Log("本地IP :" + localIP);
     deviceList = new Dictionary <string, string[]>();
 }
Exemplo n.º 2
0
    //开启Tcp服务端
    public void StartSever()
    {
        //定义侦听端口
        IPEndPoint ipEnd = new IPEndPoint(IPAddress.Any, 7772);

        serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
        serverSocket.Bind(ipEnd);
        serverSocket.Listen(10);

        Debug.Log("Tcp服务器开启,等待连接。。。" + GameTool.GetLocalIP());
        serverThread = new Thread(ServerThread);
        serverThread.IsBackground = true;
        serverThread.Start();
    }
Exemplo n.º 3
0
 public void Awake()
 {
     _client = new GameClient();
     Debug.Log("本地IP :" + GameTool.GetLocalIP());
 }