コード例 #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());
        }
コード例 #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();
        }
コード例 #3
0
ファイル: Utils.cs プロジェクト: 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);
 }
コード例 #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);
            }
        }