aboutsummaryrefslogtreecommitdiffstats
path: root/v3/libsendbuf/README.txt
blob: 518c1ee62c0d0a858fa99749b66303e9cf4e7a44 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
libsendbuf - buffer helper for sending fixed size data

You give sendbuf_new a send_func callback, a buffer size and a
maximum milisecond to wait before sending, and libsendbuf will
call the send_func appropriatly.

2 ways to add data to the buffer:
* sendbuf_append, where you give yourself the token to add to the
buffer
* sendbuf_gettoken, that avoids memcpy by returning you a pointer
where you will write directly to the buffer

ALTERNATIVES
You can use libevent bufferevent / evbuffer instead.
www.wangafu.net/~nickm/libevent-book/Ref6_bufferevent.html 
http://www.wangafu.net/~nickm/libevent-book/Ref7_evbuffer.html