Ejemplo n.º 1
0
 public Exec(Session session)
     : base(session)
 {
     Type          = ChannelType.Exec;
     StandardOut   = new NotifyStream();
     StandardError = new NotifyStream();
     waitHandle    = new EventWaitHandle(false, EventResetMode.AutoReset);
 }
 private static BinaryLogger CreateBinaryLogger(NotifyStream stream, PipExecutionContext context, Guid logId, int lastStaticAbsolutePathIndex)
 {
     return(new BinaryLogger(
                stream,
                context,
                logId,
                lastStaticAbsolutePathIndex,
                closeStreamOnDispose: true));
 }
Ejemplo n.º 3
0
 private static BinaryLogger CreateBinaryLogger(NotifyStream stream, PipExecutionContext context, Guid logId, int lastStaticAbsolutePathIndex)
 {
     return(new BinaryLogger(
                stream,
                context,
                logId,
                lastStaticAbsolutePathIndex,
                closeStreamOnDispose: true,
                onEventWritten: () => stream.FlushIfNeeded()));
 }
Ejemplo n.º 4
0
        public Shell(Session session, bool useConsole = false, bool removeTerminalEmulationCharacters = true)
            : base(session)
        {
            Type = ChannelType.Shell;
            RemoveTerminalEmulationCharacters = removeTerminalEmulationCharacters;
            UseConsole = useConsole;

            if (!UseConsole)
            {
                InputStream = new NotifyStream();
                ((NotifyStream)InputStream).DataReceived += new EventHandler(Shell_DataReceived);
                OutputStream = new NotifyStream();
            }
            else
            {
                Console.Clear();
                Console.TreatControlCAsInput = true;
            }

            waitHandle = new EventWaitHandle(false, EventResetMode.AutoReset);
            session.Socket.WritePacket(new SshChannelOpen("session", this.LocalChannel, 0xffffffff, 0x4000));
            waitHandle.WaitOne();
        }
 private NotifyOrchestratorExecutionLogTarget(NotifyStream notifyStream, PipExecutionContext context, Guid logId, int lastStaticAbsolutePathIndex)
     : this(CreateBinaryLogger(notifyStream, context, logId, lastStaticAbsolutePathIndex))
 {
     m_notifyStream = notifyStream;
 }
Ejemplo n.º 6
0
 private NotifyMasterExecutionLogTarget(NotifyStream stream, PipExecutionContext context, Guid logId, int lastStaticAbsolutePathIndex)
     : base(new BinaryLogger(stream, context, logId, lastStaticAbsolutePathIndex, closeStreamOnDispose: true, onEventWritten: () => stream.FlushIfNeeded()), closeLogFileOnDispose: true)
 {
 }