ShellStream in Windows Phone 7

Mar 9, 2013 at 8:38 PM
Edited Mar 9, 2013 at 8:40 PM
Hi. I try to write simple ssh client for windows phone. So, I have a trouble.

        public string ExecuteCommandByShell(string command)
        {
            ShellStream stream = _sshClient.CreateShellStream("xterm", 80, 24, 800, 600, 1024);
            StreamReader reader = new StreamReader(stream);
            StreamWriter writer = new StreamWriter(stream);
            writer.AutoFlush = true;
            while (stream.Length == 0)
            {
                Thread.Sleep(500);
            }
            string text = reader.ReadToEnd();
            writer.WriteLine(command);
            text = reader.ReadToEnd();
            return text;
        }
I want to execute command from param of function on remote computer via ssh. If I do it by

        public string ExecuteCommand(string command)
        {
            var commandResult = _sshClient.RunCommand(command);
            return commandResult.Result;
        }
it'll be okay, but it isn't good way for my task. Can you tell me, what's wrong?

Best Regards, Max Zhukov.
Mar 9, 2013 at 8:41 PM
Edited Mar 9, 2013 at 8:41 PM
sorry, there is troubles with my internet connection...