Пример #1
0
        private static void Start()
        {
            var listener = new TcpListener(Ipaddress, InterfacePort);

            ConsoleHelper.PrintCsiModuleStart(InterfacePort.ToString());

            try
            {
                listener.Start();
                while (true)
                {
                    Thread.Sleep(1);
                    while (!listener.Pending())
                    {
                        Thread.Sleep(SleepTime);
                    }
                    var incoming = listener.AcceptSocket();

                    var authentificationId = GenerateAuthentificationId();
                    var connection         = new ClientConnection(incoming, authentificationId);
                    ConsoleHelper.PrintNewConnection(connection);

                    MobileDeviceManagement.QueueConnectionForAuthentification(connection, authentificationId);
                    connection.Respond("AUTHDEVICE" + "$" + authentificationId);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("CSI Error. Connection Failed! \n Reason: " + ex.Message);
            }
        }
Пример #2
0
        private static void Initialize()
        {
            Console.WriteLine("INIT...");
            Thread.Sleep(666);

            RandomOperations.Initialize();
            UserInputInterpreter.Initialize();
            ClientSocketInterface.Initialize();
            MobileDeviceManagement.Initialize();
            EchoModeOn = false;
            //_gui = new MainForm();
            //Settings.Initialize();

            Console.WriteLine("INIT COMPLETE...");
            Console.Title = "Crowdsound CSA " + About.VERSION_NUMBER;
            ConsoleHelper.PrintProgramIdent();
        }