Beispiel #1
0
        private void SSHDataReceived(object sender, Renci.SshNet.Common.ShellDataEventArgs e)
        {
            string Buffer;


            Buffer = m_SSHStream.Read();
            m_Serial.Write(Buffer);
        }
        private void _OnDataReceived(object sender, Renci.SshNet.Common.ShellDataEventArgs e)
        {
            string input = Encoding.UTF8.GetString(e.Data);

            if (IncomingData != null)
            {
                IncomingData.Invoke(this, new IncomingDataEventArgs {
                    Data = input
                });
            }
        }
Beispiel #3
0
 private void Stream_DataReceived(object sender, Renci.SshNet.Common.ShellDataEventArgs e)
 {
     terminal.BeginChange();
     if (DataAvailable != null)
     {
         DataAvailable(this, EventArgs.Empty);
     }
     else
     {
         throw new InvalidOperationException("Data was received but no one was listening.");
     }
     terminal.EndChange();
 }
Beispiel #4
0
 private void Stream_DataReceived(object sender, Renci.SshNet.Common.ShellDataEventArgs e)
 {
     terminal.BeginChange();
     if (DataAvailable != null)
     {
         DataAvailable(this, new DataAvailableEventArgs(e.Data.Length));
         outputQueue.Enqueue(middle.GetCopy());
         outputWait.Set();
     }
     else
     {
         throw new InvalidOperationException("Data was received but no one was listening.");
     }
     terminal.EndChange();
 }
Beispiel #5
0
        private void ShellStream_DataReceived(object sender, Renci.SshNet.Common.ShellDataEventArgs e)
        {
            //var commands = this.parser.Parse(e.Data);
            //if (commands != null && commands.Count > 0)
            //{
            //    if (this.CommandReceived != null)
            //    {
            //        this.CommandReceived(sender, commands);
            //    }
            //}

            if (this.DataReceived != null)
            {
                this.DataReceived(this, e.Data);
            }
        }
Beispiel #6
0
        private void DataReceivedEventHandler(object sender, Renci.SshNet.Common.ShellDataEventArgs e)
        {
            while (shellStream.DataAvailable || fifo.Count > 0)
            {
                string sshdata;
                sshdata = sread.ReadToEnd();
                String output = "";
                String line   = "";
                if (!String.IsNullOrEmpty(sshdata))
                {
                    Console.Write(sshdata);

                    char[] c = sshdata.ToCharArray();
                    sshdata = "";
                    for (int i = 0; i < c.Length; i++)
                    {
                        if (c[i] == '\r')
                        {
                            i++;
                        }
                        if (c[i] == '\n')
                        {
                            fifo.Enqueue(line);
                            line = "";
                        }
                        else
                        {
                            line = line + c[i];
                        }
                    }
                }
                if (fifo.Count > 0)
                {
                    output = fifo.Dequeue();
                }

                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine(output);
                Console.ForegroundColor = ConsoleColor.Gray;
            }
        }
 private void Shell_DataReceived(object sender, Renci.SshNet.Common.ShellDataEventArgs e)
 {
     Console.Write(Encoding.UTF8.GetString(e.Data));
 }
Beispiel #8
0
 private void Shell_DataReceived(object sender, Renci.SshNet.Common.ShellDataEventArgs e)
 {
     Console.WriteLine("Line: {0} Data: {1}", e.Line, Encoding.UTF8.GetString(e.Data));
 }
Beispiel #9
0
 /// <summary>
 /// Receive data from SSH client and send to update pipe for processing my web client
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void ShellStream_DataReceived(object sender, Renci.SshNet.Common.ShellDataEventArgs e)
 {
     pipeMessaging.SendUpdatePipeMessage(e.Data);
 }
Beispiel #10
0
 private void ShellStream_DataReceived(object sender, Renci.SshNet.Common.ShellDataEventArgs e)
 {
     WriteTextSafe(reader.ReadToEnd());
 }
Beispiel #11
0
 private void Stream_DataReceived(object sender, Renci.SshNet.Common.ShellDataEventArgs e)
 {
     received.Release();
 }