public override void SetUp() { base.SetUp(); localIP = GameTool.GetLocalIP(); userName = localIP; Debug.Log("本地IP :" + localIP); deviceList = new Dictionary <string, string[]>(); }
//开启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(); }
public void Awake() { _client = new GameClient(); Debug.Log("本地IP :" + GameTool.GetLocalIP()); }