Exemplo n.º 1
0
        void rcallback(IntPtr streamPointer, IntPtr size)
        {
            long nread = size.ToInt64();

            if (nread == 0)
            {
                return;
            }
            else if (nread < 0)
            {
                if (UVException.Map((int)nread) == UVErrorCode.EOF)
                {
                    Close(Complete);
                }
                else
                {
                    OnError(Ensure.Map((int)nread));
                    Close();
                }
            }
            else
            {
                OnData(ByteBufferAllocator.Retrieve(size.ToInt32()));
            }
        }
Exemplo n.º 2
0
        internal void read_callback(IntPtr stream, IntPtr size)
        {
            long nread = size.ToInt64();

            if (nread == 0)
            {
                return;
            }
            else if (nread < 0)
            {
                if (nread == (long)uv_err_code.UV_EOF)
                {
                    Close(Complete);
                }
                else
                {
                    OnError(Ensure.Map((int)nread));
                    Close();
                }
            }
            else
            {
                OnData(ByteBufferAllocator.Retrieve(size.ToInt32()));
            }
        }
Exemplo n.º 3
0
        public void End(IntPtr ptr)
        {
            Exception e = null;

            if (Result.ToInt32() == -1)
            {
                uv_err_t err = new uv_err_t(Error);
                e = Ensure.Map(err, (string.IsNullOrEmpty(Path) ? null : Path));
            }

            if (Callback != null)
            {
                Callback(e);
            }
            Dispose();
        }
Exemplo n.º 4
0
        public void End(IntPtr ptr)
        {
            Exception e = null;
            var       r = Result.ToInt32();

            if (r < 0)
            {
                e = Ensure.Map(r, (string.IsNullOrEmpty(Path) ? null : Path));
            }

            if (Callback != null)
            {
                Callback(e);
            }

            Dispose();
        }
Exemplo n.º 5
0
        public void End(IntPtr ptr)
        {
            // good idea when you have only the pointer, but no need for it ...
            // var fsr = new FileSystemRequest(ptr, false).Value.Target as FileSystemRequest;
            Exception e = null;

            if (Result.ToInt32() == -1)
            {
                uv_err_t err = new uv_err_t(Error);
                Callback(Ensure.Map(err), null);
            }

            if (Callback != null)
            {
                Callback(e, this);
            }
            Dispose();
        }