Ejemplo n.º 1
0
        public void Write(byte[] data, int offset, int length, Action <UvDataArgs> callback = null)
        {
            IntPtr req = IntPtr.Zero;

            try
            {
                req = this.Loop.Requests.Create(uv_req_type.UV_WRITE, data, offset, length);
                CheckError((Uvi.uv_write(req, this.Handle, new[] { this.Loop.Requests[req] }, 1, _writeDelegate)));
                _writeCallbacks.Add(req, new UvDataCallback(this, callback, data));
            }
            catch (Exception)
            {
                this.Loop.Requests.Delete(req);
                throw;
            }
        }