예제 #1
0
        public void Init(UvLoopHandle loop, Action <Action <IntPtr>, IntPtr> queueCloseHandle)
        {
            CreateHandle(
                loop.Libuv,
                loop.ThreadId,
                loop.Libuv.handle_size(Uv.HandleType.TIMER),
                queueCloseHandle);

            _uv.timer_init(loop, this);
        }
예제 #2
0
        public void DangerousInit(UvLoopHandle loop)
        {
            var requestSize = loop.Libuv.req_size(Uv.RequestType.WRITE);
            var bufferSize  = Marshal.SizeOf <Uv.uv_buf_t>() * BUFFER_COUNT;

            CreateMemory(
                loop.Libuv,
                loop.ThreadId,
                requestSize + bufferSize);
            _bufs = handle + requestSize;
        }
예제 #3
0
        public void Init(UvLoopHandle loop, Action callback, Action <Action <IntPtr>, IntPtr> queueCloseHandle)
        {
            CreateMemory(
                loop.Libuv,
                loop.ThreadId,
                loop.Libuv.handle_size(Uv.HandleType.ASYNC));

            _callback         = callback;
            _queueCloseHandle = queueCloseHandle;
            _uv.async_init(loop, this, _uv_async_cb);
        }
예제 #4
0
        public UvThread(ILibuvTrace log)
        {
            _log         = log;
            _loop        = new UvLoopHandle(_log);
            _post        = new UvAsyncHandle(_log);
            _thread      = new Thread(ThreadStart);
            _thread.Name = "Libuv event loop";

            _threadTcs            = new TaskCompletionSource <object>();
            QueueCloseHandle      = PostCloseHandle;
            QueueCloseAsyncHandle = EnqueueCloseHandle;
            WriteReqPool          = new WriteReqPool(this, _log);
            MemoryPool            = KestrelMemoryPool.Create();
        }
예제 #5
0
 public static extern int uv_pipe_init(UvLoopHandle loop,UvPipeHandle handle,int ipc);
예제 #6
0
 public static extern int uv_walk(UvLoopHandle loop,uv_walk_cb walk_cb,IntPtr arg);
예제 #7
0
 public static extern int uv_async_init(UvLoopHandle loop,UvAsyncHandle handle,uv_async_cb cb);
예제 #8
0
 public static extern int uv_tcp_init(UvLoopHandle loop,UvTcpHandle handle);
예제 #9
0
 public void stop(UvLoopHandle handle)
 {
     handle.Validate();
     _uv_stop(handle);
 }
예제 #10
0
 public static extern void uv_stop(UvLoopHandle handle);
예제 #11
0
 public void loop_close(UvLoopHandle handle)
 {
     handle.Validate(closed: true);
     ThrowIfErrored(_uv_loop_close(handle.InternalGetHandle()));
 }
예제 #12
0
 public void loop_init(UvLoopHandle handle)
 {
     ThrowIfErrored(_uv_loop_init(handle));
 }
예제 #13
0
 public void walk(UvLoopHandle loop, uv_walk_cb walk_cb, IntPtr arg)
 {
     loop.Validate();
     _uv_walk(loop, walk_cb, arg);
 }
예제 #14
0
 unsafe public void timer_init(UvLoopHandle loop, UvTimerHandle handle)
 {
     loop.Validate();
     handle.Validate();
     ThrowIfErrored(_uv_timer_init(loop, handle));
 }
예제 #15
0
 public void pipe_init(UvLoopHandle loop, UvPipeHandle handle, bool ipc)
 {
     loop.Validate();
     handle.Validate();
     ThrowIfErrored(_uv_pipe_init(loop, handle, ipc ? -1 : 0));
 }
예제 #16
0
 public void tcp_init(UvLoopHandle loop, UvTcpHandle handle)
 {
     loop.Validate();
     handle.Validate();
     ThrowIfErrored(_uv_tcp_init(loop, handle));
 }
예제 #17
0
 public void async_init(UvLoopHandle loop, UvAsyncHandle handle, uv_async_cb cb)
 {
     loop.Validate();
     handle.Validate();
     ThrowIfErrored(_uv_async_init(loop, handle, cb));
 }
예제 #18
0
 unsafe public static extern int uv_timer_init(UvLoopHandle loop,UvTimerHandle handle);
예제 #19
0
 public static extern int uv_loop_init(UvLoopHandle handle);
예제 #20
0
 unsafe public static extern long uv_now(UvLoopHandle loop);
예제 #21
0
 public static extern int uv_run(UvLoopHandle handle,int mode);
예제 #22
0
 unsafe public long now(UvLoopHandle loop)
 {
     loop.Validate();
     return(_uv_now(loop));
 }
예제 #23
0
 public void run(UvLoopHandle handle, int mode)
 {
     handle.Validate();
     ThrowIfErrored(_uv_run(handle, mode));
 }