Example #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);
        }
Example #2
0
 public TesterUT()
 {
     try
     {
         string filename = String.Format("{0}\\systemreport.csv", Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase));
         filename = filename.Substring(6);
         Marshall.User(filename);
         fs            = File.Open(filename, FileMode.Append, FileAccess.Write, FileShare.Read);
         SystemReport += TesterUT_SystemReport;
     }
     catch (Exception e)
     {
         Marshall.Error(String.Format("SYSTEM REPORT DESHABILITADO!!! ERROR={0}", e));
     }
     AutoReport      += TesterUT_AutoReport;
     RFIDDetected    += TesterUT_RFIDDetected;
     ExcesoVelocidad += TesterUT_ExcesoVelocidad;
 }