public void ClientStart() { server.Close(); client.Close(); server = new NetFileTSever.NFTServer(); client = new NetFileTClient.NFTClient(); server.run(Clientport); client.ConnectToIp(Serverip, Serverport); while (client.Transmission(EnCoder.StartMessage()) != 0) { Debug.Log("retry"); } NetWorkScript.isConnected = true; }
public void Start() { if (isServer) { server = new NetFileTSever.NFTServer(); client = new NetFileTClient.NFTClient(); server.run(Serverport); } else { server = new NetFileTSever.NFTServer(); client = new NetFileTClient.NFTClient(); server.run(Clientport); client.ConnectToIp(Serverip, Serverport); while (client.Transmission(EnCoder.StartMessage()) != 0) { Debug.Log("retry"); } netWorkTest.isConnected = true; } }