On Sat, Mar 27, 2010 at 3:38 PM, Marc Lehmann <schm...@schmorp.de> wrote: > On Sat, Mar 27, 2010 at 07:21:52PM +0000, Chris Dew <cms...@googlemail.com> > wrote: >> // Lots of globals, what's the best way to get rid of these? > > put them into a struct, maybe together with the watcher(s), and put it's > address intot eh data pointer (or or some othe rtechnique described in the > libev manual). >
If you want a more complex/complete example, you can look at some of my code over here: http://code.google.com/p/gdnsd/source/browse/trunk/gdnsd/dnsio_tcp.c There be many dragons in this code, but you can see the basic per-thread/per-conn data structures and how they're passed around and how the callbacks are set up with timeouts and so-on. -- Brandon _______________________________________________ libev mailing list libev@lists.schmorp.de http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev