コード例 #1
0
 public Exec(Session session)
     : base(session)
 {
     Type          = ChannelType.Exec;
     StandardOut   = new NotifyStream();
     StandardError = new NotifyStream();
     waitHandle    = new EventWaitHandle(false, EventResetMode.AutoReset);
 }
コード例 #2
0
 private static BinaryLogger CreateBinaryLogger(NotifyStream stream, PipExecutionContext context, Guid logId, int lastStaticAbsolutePathIndex)
 {
     return(new BinaryLogger(
                stream,
                context,
                logId,
                lastStaticAbsolutePathIndex,
                closeStreamOnDispose: true));
 }
コード例 #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()));
 }
コード例 #4
0
ファイル: Shell.cs プロジェクト: neoscrib/secureshell
        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();
        }
コード例 #5
0
 private NotifyOrchestratorExecutionLogTarget(NotifyStream notifyStream, PipExecutionContext context, Guid logId, int lastStaticAbsolutePathIndex)
     : this(CreateBinaryLogger(notifyStream, context, logId, lastStaticAbsolutePathIndex))
 {
     m_notifyStream = notifyStream;
 }
コード例 #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)
 {
 }