static void CloseCallback(ref eio_req req) { var handle = GCHandle.FromIntPtr(req.data); ((Action <int>)handle.Target)(req.result.ToInt32()); handle.Free(); }
static void OpenCallback(ref eio_req req) { var handle = GCHandle.FromIntPtr(req.data); ((Action <int, int>)handle.Target)(req.result.ToInt32(), req.errorno); handle.Free(); }
static void SendfileCallback(ref eio_req req) { var handle = GCHandle.FromIntPtr(req.data); ((Action <long, int>)handle.Target)(req.result.ToInt64(), req.errorno); handle.Free(); }
static void ReadCallback(ref eio_req req) { var handle = GCHandle.FromIntPtr(req.data); var tuple = (Tuple <byte [], Action <int, byte [], int> >)handle.Target; tuple.Item2(req.result.ToInt32(), tuple.Item1, req.errorno); handle.Free(); }
static void StatCallback(ref eio_req req) { Stat result; int errno = req.errorno; if (!NativeConvert.TryCopy(req.ptr2, out result)) { Console.Error.WriteLine("Error converting stat structure."); errno = 0xFF; } var handle = GCHandle.FromIntPtr(req.data); ((Action <int, Stat, int>)handle.Target)(req.result.ToInt32(), result, errno); handle.Free(); }
static void StatCallback(ref eio_req req) { Stat result; int errno = req.errorno; if (!NativeConvert.TryCopy (req.ptr2, out result)) { Console.Error.WriteLine ("Error converting stat structure."); errno = 0xFF; } var handle = GCHandle.FromIntPtr (req.data); ((Action<int, Stat, int>) handle.Target) (req.result.ToInt32 (), result, errno); handle.Free (); }
static void SendfileCallback(ref eio_req req) { var handle = GCHandle.FromIntPtr (req.data); ((Action<long, int>) handle.Target) (req.result.ToInt64 (), req.errorno); handle.Free (); }
static void ReadCallback(ref eio_req req) { var handle = GCHandle.FromIntPtr (req.data); var tuple = (Tuple<byte [], Action<int, byte [], int>>) handle.Target; tuple.Item2 (req.result.ToInt32 (), tuple.Item1, req.errorno); handle.Free (); }
static void OpenCallback(ref eio_req req) { var handle = GCHandle.FromIntPtr (req.data); ((Action<int, int>) handle.Target) (req.result.ToInt32 (), req.errorno); handle.Free (); }
static void CloseCallback(ref eio_req req) { var handle = GCHandle.FromIntPtr (req.data); ((Action<int>) handle.Target) (req.result.ToInt32 ()); handle.Free (); }