aboutsummaryrefslogtreecommitdiffstats
path: root/libglouglou/sendbuf.h
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2012-12-01 04:22:41 +0100
committerLaurent Ghigonis <laurent@p1sec.com>2012-12-01 04:22:41 +0100
commit94d722d144b92cf64f7be022f542e0cef3341780 (patch)
tree82e3d3aed66ac8a25b3d23aa631569d7bc1939c4 /libglouglou/sendbuf.h
parentexplictly set source and headers (diff)
downloadglouglou-94d722d144b92cf64f7be022f542e0cef3341780.tar.xz
glouglou-94d722d144b92cf64f7be022f542e0cef3341780.zip
work in progress on implementing a send buffer
Diffstat (limited to 'libglouglou/sendbuf.h')
-rw-r--r--libglouglou/sendbuf.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/libglouglou/sendbuf.h b/libglouglou/sendbuf.h
new file mode 100644
index 0000000..90dc4bc
--- /dev/null
+++ b/libglouglou/sendbuf.h
@@ -0,0 +1,21 @@
+#include <event.h>
+
+struct sendbuf {
+ struct event_base *ev_base;
+ struct event *ev_timer;
+ struct timeval ev_timer_tv;
+ int sndbuf_max;
+ int msec_max;
+ int (*send_func)(void *, int, void *);
+ void *usrdata;
+ void *buffer;
+ int buffer_size;
+ int buffer_pos;
+ int flushing;
+ int flushed_len;
+};
+
+struct sendbuf *sendbuf_init(struct event_base *, int, int,
+ int (*send_func)(void *, int, void *), void *);
+void sendbuf_shutdown(struct sendbuf *);
+void *sendbuf_gettoken(struct sendbuf *, int);