Exemplo n.º 1
0
Arquivo: IO.cs Projeto: kgober/VT52
 private void Receive(Object sender, IOEventArgs e)
 {
     if (e.Type == IOEventType.Data)
     {
         Int32 n;
         while ((n = mTelnet.ReadByte()) != -1)
         {
             EventHandler h = IOEvent;
             if (h != null) h(this, new IOEventArgs(IOEventType.Data, (Byte)n));
         }
     }
     else if (e.Type == IOEventType.Break)
     {
         EventHandler h = IOEvent;
         if (h != null)
         {
             h(this, new IOEventArgs(IOEventType.Break, 1));
             h(this, new IOEventArgs(IOEventType.Break, 0));
         }
     }
     else if (e.Type == IOEventType.Flush)
     {
         EventHandler h = IOEvent;
         if (h != null) h(this, new IOEventArgs(IOEventType.Flush, 0));
     }
     else if (e.Type == IOEventType.Disconnect)
     {
         EventHandler h = IOEvent;
         if (h != null) h(this, new IOEventArgs(IOEventType.Disconnect, 0));
     }
 }
Exemplo n.º 2
0
Arquivo: IO.cs Projeto: kgober/VT52
 private void Receive(Object sender, IOEventArgs e)
 {
     if (e.Type == IOEventType.Data)
     {
         Int32 n;
         while ((n = mRawTCP.ReadByte()) != -1)
         {
             EventHandler h = IOEvent;
             if (h != null) h(this, new IOEventArgs(IOEventType.Data, (Byte)n));
         }
     }
 }