Example #1
0
    private void SetupClient()
    {
        if (File.Exists("ip.txt"))
        {
            using (StreamReader reader = new StreamReader("ip.txt"))
            {
                string inputText = reader.ReadToEnd();
                reader.Close();

                Debug.Log(inputText);

                server = inputText.Substring(0, inputText.IndexOf(":"));
                port   = int.Parse(inputText.Substring(inputText.IndexOf(":") + 1));

                Debug.Log(server);
                Debug.Log(port);
            }
        }

        Socket.ConnectToTcpServer(server, port);
    }
Example #2
0
 // Start is called before the first frame update
 void Start()
 {
     tcp.ConnectToTcpServer();
 }