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()); }
// 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(); }
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); }
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); } }