Ejemplo n.º 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;
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 3
0
 extern static int uv_udp_recv_start_unix(IntPtr handle, alloc_callback_unix alloc_callback, recv_start_callback_unix callback);
Ejemplo n.º 4
0
 internal static extern int uv_udp_recv_start_unix(IntPtr handle, alloc_callback_unix alloc_callback, recv_start_callback_unix callback);