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)); }
private static BinaryLogger CreateBinaryLogger(NotifyStream stream, PipExecutionContext context, Guid logId, int lastStaticAbsolutePathIndex) { return(new BinaryLogger( stream, context, logId, lastStaticAbsolutePathIndex, closeStreamOnDispose: true, onEventWritten: () => stream.FlushIfNeeded())); }
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; }
private NotifyMasterExecutionLogTarget(NotifyStream stream, PipExecutionContext context, Guid logId, int lastStaticAbsolutePathIndex) : base(new BinaryLogger(stream, context, logId, lastStaticAbsolutePathIndex, closeStreamOnDispose: true, onEventWritten: () => stream.FlushIfNeeded()), closeLogFileOnDispose: true) { }