Exemplo n.º 1
0
        public override async void Start(FrameBase frameBase)
        {
            var frame = frameBase as RedirectedInputFrame;

            if (frame == null)
            {
                return;
            }

            Process process = ProcessList.Get(frame.Guid);

            if (process == null)
            {
                await SendError(frame, "Process has exited.").ConfigureAwait(false);
            }
            else
            {
                try
                {
                    await process.StandardInput.WriteAsync(frame.Data).ConfigureAwait(false);
                }
                catch (Exception ex)
                {
                    await SendError(frame, ex.Message).ConfigureAwait(false);
                }
            }
        }
Exemplo n.º 2
0
        public override void Start(FrameBase frameBase)
        {
            var frame = frameBase as KillFrame;

            if (frame == null)
            {
                return;
            }

            Process process = ProcessList.Get(frame.Guid);

            if (process != null)
            {
                try
                {
                    process.Kill();
                }
                catch { }
            }
        }