Beispiel #1
0
        public ServerExplorer(string clusterName)
        {
            InitializeComponent();
            CheckForIllegalCrossThreadCalls = false;
            cluster_name     = clusterName;
            UpdateTree       = UpdateTreeImpl;
            conexion.Destino = new Destino();

            IPHostEntry he = null;
            string      imei;

            try
            {
                while (he == null)
                {
                    he = Dns.GetHostEntry(Config.GetConfigurationString(cluster_name, "server_ip_address", "localhost"));
                    Marshall.Debug(String.Format("CONSOLE: Esperando que resuelva {0}", ConfigurationManager.AppSettings["ip_address"]));
                    Thread.Sleep(1000);
                }
                imei = ConfigurationManager.AppSettings[cluster_name + ".client_identifier"];
            }
            catch (Exception)
            {
                Marshall.Error("ERROR FATAL: La configuracion no es valida, revisar.");
                return;
            }
            conexion.Destino.UDP   = new IPEndPoint(he.AddressList[0], 2357);
            conexion.IMEI          = imei;
            conexion.Password      = "******";
            conexion.StateChange  += conexion_StateChange;
            conexion.DeviceUpdate += conexion_DeviceUpdate;
            conexion.Init(7532, 8192);
        }