Ejemplo n.º 1
0
        public void Write(byte[] buffer, int offset, int count)
        {
            if (PipeStream == null || PipeStream.IsConnected == false)
            {
                return;
            }

            PipeStream.BeginWrite(buffer, offset, count, (asyncResult) =>
            {
                PipeStream.EndWrite(asyncResult);

                EventWrite?.Invoke(new IOEventResult(this, IOEventType.Write, AegisResult.Ok));
            }, null);
        }
Ejemplo n.º 2
0
        public bool Write(byte[] buffer, int offset, int count)
        {
            try
            {
                lock (this)
                {
                    Handle?.Write(buffer, offset, count);
                    EventWrite?.Invoke(new IOEventResult(this, IOEventType.Write, AegisResult.Ok));
                }

                return(true);
            }
            catch (Exception e)
            {
                ErrorHandler?.Invoke(e);
                Logger.Err(LogMask.Aegis, e.Message);

                return(false);
            }
        }