예제 #1
0
        /// <summary>
        /// Stops data reading for the stream. The <see cref="ReadCallbackDelegate"/> callback will no longer be called.
        /// </summary>
        public void ReadStop()
        {
            this.EnsureCallingThread();
            if (!this._ReadVitality.IsAllocated)
            {
                throw new InvalidOperationException("ReadStart must be called before ReadStop may be called.");
            }
            this._UserAllocCallback = null;
            this._UserReadCallback  = null;
            this._UserReadState     = null;
            this._ReadVitality.Free();

            Libuv.EnsureSuccess(Libuv.uv_read_stop(this));
        }