Ejemplo n.º 1
0
        public static async void tratarDados()
        {
            //sla como faço isso por enquanto
            if (canalRede == null)
            {
                emissorP2P = escutarPeer.Result;
                canalRede  = emissorP2P.GetStream();
            }
            byte[] meuBuffer = new byte[2048];
            int    res       = await canalRede.ReadAsync(meuBuffer, 0, 2048);

            if (res < 0)
            {
                throw new Exception("Leitura de Buffer não deu certo!");
            }
            if (res != 0)
            {
                if (ControladorDesenhavel.Interpretando)
                {
                    return;
                }
                // DesenhavelRepositorio.limpar();
                byte[] buffer = new byte[res];
                for (int i = 0; i < res; i++)
                {
                    buffer[i] = meuBuffer[i];
                }
                ConexaoP2P.buffer = buffer;
                finalizarConexao();
                ControladorDesenhavel.tratarDados();
            }
        }
Ejemplo n.º 2
0
 public static void tratarDados()
 {
     //byte[] buffer = ;
     if (!ControladorDesenhavel.Interpretando)
     {
         ControladorDesenhavel.interpretarBuffer(ConexaoP2P.Buffer);
     }
 }