Esempio n. 1
0
        public void AbortClient()
        {
            Listener.Disconnect();
            Listener = null;

            IsHost = false;
            IsClient = false;

            FireChange();
        }
Esempio n. 2
0
        public void ConfigureClient(string ip, string sPort)
        {
            int port;
            if (Int32.TryParse(sPort, out port))
            {
                Listener = new TelemetryClient();
                Listener.IP = ip;
                Listener.Port = port;
                if (Listener.Connect())
                {
                    IsHost = false;
                    IsClient = true;
                }
                else
                {
                    FireError("Failed to connect to " + ip + ":" + port);
                }

                FireChange();
            }
            else
            {
                FireError("Invalid server port");
            }
        }