Connect() public method

public Connect ( ) : bool
return bool
Esempio n. 1
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");
            }
        }
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");
            }
        }