Esempio n. 1
0
        internal static int RunLoop(IntPtr handle, uv_run_mode mode)
        {
            if (handle != IntPtr.Zero)
            {
                /*
                 * UV_RUN_DEFAULT:
                 *  Runs the event loop until there are no more active and referenced handles or requests.
                 *  Returns non-zero if uv_stop() was called and there are still active handles or requests.
                 *  Returns zero in all other cases.
                 *
                 * UV_RUN_ONCE:
                 *  Poll for i/o once. Note that this function blocks if there are no pending callbacks.
                 *  Returns zero when done (no active handles or requests left),
                 *  or non-zero if more callbacks are expected(meaning you should run the event loop again sometime in the future).
                 *
                 * UV_RUN_NOWAIT:
                 *  Poll for i/o once but don’t block if there are no pending callbacks.
                 *  Returns zero if done(no active handles or requests left),
                 *  or non-zero if more callbacks are expected(meaning you should run the event loop again sometime in the future).
                 */

                return(uv_run(handle, mode));
            }
            else
            {
                throw new ArgumentException("Handle can't be null!");
            }
        }
Esempio n. 2
0
        internal static int RunLoop(IntPtr handle, uv_run_mode mode)
        {
            if (handle == IntPtr.Zero)
            {
                throw new ArgumentException("Empty handle value is not valid.");
            }

            /*
             * UV_RUN_DEFAULT:
             *  Runs the event loop until there are no more active and referenced handles or requests.
             *  Returns non-zero if uv_stop() was called and there are still active handles or requests.
             *  Returns zero in all other cases.
             *
             * UV_RUN_ONCE:
             *  Poll for i/o once. Note that this function blocks if there are no pending callbacks.
             *  Returns zero when done (no active handles or requests left),
             *  or non-zero if more callbacks are expected(meaning you should run the event loop again sometime in the future).
             *
             * UV_RUN_NOWAIT:
             *  Poll for i/o once but don’t block if there are no pending callbacks.
             *  Returns zero if done(no active handles or requests left),
             *  or non-zero if more callbacks are expected(meaning you should run the event loop again sometime in the future).
             */

            int result = InvokeFunction(uv_run, handle, mode);

            Log.Debug($"Native run loop {handle} {mode}, result = {result}");
            return(result);
        }
Esempio n. 3
0
        public int Run(uv_run_mode mode)
        {
            Validate();
            uv_run_inprogress = true;
            int result = NativeMethods.RunLoop(Handle, mode);

            uv_run_inprogress = false;
            return(result);
        }
Esempio n. 4
0
 static extern void uv_run(IntPtr loop, uv_run_mode mode);
Esempio n. 5
0
 public int Run(uv_run_mode mode)
 {
     Validate();
     return(NativeMethods.uv_run(_handle, mode));
 }
Esempio n. 6
0
 internal int Run(uv_run_mode mode)
 {
     this.Validate();
     return(NativeMethods.RunLoop(this.Handle, mode));
 }
Esempio n. 7
0
 internal static extern int uv_run(IntPtr loop, uv_run_mode uv_run_mode);
Esempio n. 8
0
 static extern int uv_run(IntPtr handle, uv_run_mode mode);
Esempio n. 9
0
 static extern void uv_run(IntPtr loop, uv_run_mode mode);
Esempio n. 10
0
 internal static extern int uv_run(IntPtr loop, uv_run_mode uv_run_mode);         // uv_loop_t*
Esempio n. 11
0
 public static extern int uv_run(IntPtr loop, uv_run_mode mode);
Esempio n. 12
0
 public int Run(uv_run_mode mode)
 {
     this.Validate();
     return NativeMethods.uv_run(this.handle, mode);
 }