protected override void RunOperations()
 {
     try {
         channel = Ssh.GetChannel(command);
         channel.setErrStream(new TextStream(stdErr));
         channel.setOutputStream(new TextStream(stdOut));
         channel.connect();
         while (!channel.isEOF())
         {
             Thread.Sleep(200);
         }
         channel.disconnect();
     } finally {
         ExitCode = channel.getExitStatus();
     }
 }
Ejemplo n.º 2
0
            public override void Close()
            {
                base.Close();

                if (_channel != null)
                {
                    try
                    {
                        _exitStatus = _channel.getExitStatus();

                        if (_channel.isConnected())
                        {
                            _channel.disconnect();
                        }
                    }
                    finally
                    {
                        _channel = null;
                    }
                }
            }