Exemplo n.º 1
0
        static void c_aio_handler(int err, IntPtr size, IntPtr h)
        {
            int idx2 = (int)h;
            var hr   = GlobalInterOpLookupTable.GetRelease(idx2) as AioHandler;

            hr(new ErrorCode(err), size.ToInt32());
        }
Exemplo n.º 2
0
        // TODO: what if the task is cancelled
        static void c_task_handler(IntPtr h)
        {
            int idx2 = (int)h;
            var hr   = GlobalInterOpLookupTable.GetRelease(idx2) as task_handler;

            hr();
        }
Exemplo n.º 3
0
Arquivo: Utils.cs Projeto: zmyer/rDSN
 public bool Cancel(bool waitFinished, out bool finished)
 {
     if (Native.dsn_task_cancel2(handle, waitFinished, out finished))
     {
         GlobalInterOpLookupTable.GetRelease(_callback_index);
         return(true);
     }
     return(false);
 }
Exemplo n.º 4
0
        static void c_rpc_response_handler(int err, IntPtr reqc, IntPtr respc, IntPtr h)
        {
            int idx2 = (int)h;
            var hr   = GlobalInterOpLookupTable.GetRelease(idx2) as RpcResponseHandler;

            if (err == 0)
            {
                var rms = new RpcReadStream(respc, false);
                hr(new ErrorCode(err), rms);
            }
            else
            {
                hr(new ErrorCode(err), null);
            }
        }