summaryrefslogtreecommitdiff
path: root/lib/tests/udp.h
blob: 402295f27fe4823a4aabbc59330dc9bb5879504d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdint.h>
#include <unistd.h>
#include <sys/time.h>
//#include <sys/types.h>

typedef ssize_t (*data_cb) (const uint8_t *buf, ssize_t len);
struct polldata {
  int s;
  data_cb cb;
  struct timeval *timeout;
};

struct polldata *server (const char *bindto, struct timeval *timeout, data_cb cb);
ssize_t poll (struct polldata *data);