コード例 #1
0
        private void MessageLoop()
        {
            var bytes = new byte[1024 * 64];

            while (true)
            {
                var len = _process.StandardOutput.BaseStream.Read(bytes, 0, bytes.Length);
                if (len <= 0)
                {
                    break;
                }

                var data = bytes.Length != len
                    ? bytes.Take(len).ToArray()
                    : bytes;

                DataReceived?.Invoke(this, data);
            }
            EofReceived?.Invoke(this, EventArgs.Empty);
            CloseReceived?.Invoke(this, (uint)_process.ExitCode);
        }
コード例 #2
0
        internal void OnEof()
        {
            ClientMarkedEof = true;

            EofReceived?.Invoke(this, EventArgs.Empty);
        }