diff options
Diffstat (limited to 'libglouglou/sendbuf.h')
-rw-r--r-- | libglouglou/sendbuf.h | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/libglouglou/sendbuf.h b/libglouglou/sendbuf.h index 340e1c7..0290202 100644 --- a/libglouglou/sendbuf.h +++ b/libglouglou/sendbuf.h @@ -3,27 +3,21 @@ struct sendbuf { struct event_base *ev_base; - struct event *ev_timer; - struct timeval ev_timer_tv; - int sndbuf_max; + struct event *ev_timer; + struct timeval ev_timer_tv; int msec_max; -}; - -struct sendbuf_queue { - void *buffer; int buffer_size; - int buffer_pos; + void *buffer; + int buffer_pos; /* next to use in buffer */ + int flushing; + int flushing_pos; /* next to send in buffer */ int (*send_func)(void *, int, void *); void *usrdata; - int flushing; - int flushed_len; -} - -struct sendbuf *sendbuf_init(struct event_base *, int, int, int); -void sendbuf_shutdown(struct sendbuf *); -void sendbuf_queue_add(struct sendbuf *, - int (*send_func)(void *, int, void *), - void *); -void *sendbuf_token_get(struct sendbuf *, int); -void sendbuf_token_ready(struct sendbuf *, void *); +}; +struct sendbuf *sendbuf_new(struct event_base *, int, int, + int (*send_func)(void *, int, void *), + void *); +void sendbuf_free(struct sendbuf *); +int sendbuf_append(struct sendbuf *, void *, int); +void *sendbuf_gettoken(struct sendbuf *, int); |