示例#1
0
 public Udp(Loop loop)
     : base(loop, HandleType.UV_UDP)
 {
     int r = uv_udp_init(loop.NativeHandle, NativeHandle);
     Ensure.Success(r, loop);
     // we can't supply just recv_start_callback in Receive
     // because it will create a temporary delegate which could(and will) be garbage collected at any time
     // happens in my case after 10 or 20 calls
     // so we have to reference it, so it won't garbage collect it until the object itself
     // is gone
     recv_start_cb_win = recv_start_callback_w;
     recv_start_cb_unix = recv_start_callback_u;
 }
示例#2
0
        public Udp(Loop loop)
            : base(loop, UvHandleType.UV_UDP)
        {
            int r = uv_udp_init(loop.Handle, handle);

            Ensure.Success(r, loop);
            // we can't supply just recv_start_callback in Receive
            // because it will create a temporary delegate which could(and will) be garbage collected at any time
            // happens in my case after 10 or 20 calls
            // so we have to reference it, so it won't garbage collect it until the object itself
            // is gone
            recv_start_cb_win  = recv_start_callback_w;
            recv_start_cb_unix = recv_start_callback_u;
        }
示例#3
0
 extern static int uv_udp_recv_start_win(IntPtr handle, alloc_callback_win alloc_callback, recv_start_callback_win callback);
示例#4
0
 internal static extern int uv_udp_recv_start_win(IntPtr handle, alloc_callback_win alloc_callback, recv_start_callback_win callback);