libev TCP echo server example?

Chris Dew cmsdew at googlemail.com
Sun Mar 28 09:00:54 CEST 2010


Thanks for the link.  I don't suppose you've written any TCP code with
libev?

All the best,

Chris.

On 28 March 2010 01:55, Brandon Black <blblack at gmail.com> wrote:

> On Sat, Mar 27, 2010 at 3:38 PM, Marc Lehmann <schmorp at schmorp.de> wrote:
> > On Sat, Mar 27, 2010 at 07:21:52PM +0000, Chris Dew <
> cmsdew at 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
>



-- 

http://www.finalcog.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schmorp.de/pipermail/libev/attachments/20100328/f7748b46/attachment.html>


More information about the libev mailing list