On Sun, Jun 04, 2006 at 09:47:10AM +0200, Florian Lohoff wrote: > I'd rather use some linked list of buffers in which i do refcounting. > Every time i queue up a buffer on a socket i refcount it up by one, > everytime i send it out i'll refcount it down. On zero i free it because > it has been sent to all clients. >
I need to do this same type of optimization in a media reflector. I recently refactored the buffered-IO component in libevnet (on freshmeat) to use source and sink objects. It should be easy to create a simple source object for an output stream that internally used shared pages (shared across source objects). The default interface for bufio_write() takes a pointer to a buffer and will write the buffer directly to a socket. So you could also manage shared buffers that way. Might even be easier. _______________________________________________ Libevent-users mailing list Libevent-users@monkey.org http://monkey.org/mailman/listinfo/libevent-users