aboutsummaryrefslogtreecommitdiffstats
path: root/libglouglou/sendbuf.h
blob: 90dc4bcba7285e998b746de63c104b14ced99d82 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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);