Exemplo n.º 1
0
        public void Shutdown(Action <UvArgs> callback = null)
        {
            IntPtr req = IntPtr.Zero;

            try
            {
                if (_isReading)
                {
                    this.ReadStop();
                }

                req = this.Loop.Requests.Create(uv_req_type.UV_SHUTDOWN);
                CheckError(Uvi.uv_shutdown(req, this.Handle, _shutdownDelegate));
                _shutdownCallback = new UvCallback(this, callback);
            }
            catch (Exception)
            {
                this.Loop.Requests.Delete(req);
                throw;
            }
        }