public IOLoop() { evloop = Loop.CreateDefaultLoop (0); prepare_watcher = new PrepareWatcher (evloop, HandlePrepareEvent); prepare_watcher.Start (); }
private static void StaticCallback(IntPtr loop, IntPtr watcher, EventTypes revents) { UnmanagedPrepareWatcher iow = (UnmanagedPrepareWatcher)Marshal.PtrToStructure(watcher, typeof(UnmanagedPrepareWatcher)); GCHandle gchandle = GCHandle.FromIntPtr(iow.data); PrepareWatcher w = (PrepareWatcher)gchandle.Target; w.callback(w.Loop, w, revents); }
public IOLoop() { evloop = Loop.CreateDefaultLoop (0); eio = new Libeio.Libeio (); eio.Initialize (evloop); prepare_watcher = new PrepareWatcher (evloop, HandlePrepareEvent); prepare_watcher.Start (); }
private void HandlePrepareEvent(Loop loop, PrepareWatcher watcher, EventTypes revents) { if (!running) { loop.Unloop (UnloopType.All); prepare_watcher.Stop (); } }