Non-blocking connection support.

This commit is contained in:
Ian Gulliver
2016-02-17 08:05:18 +00:00
parent a8f1cb5767
commit 0db4d15897
5 changed files with 124 additions and 96 deletions

View File

@@ -7,12 +7,14 @@
//////// peer
// All specific peer structs must be castable to this.
struct peer;
typedef void (*peer_event_handler)(struct peer *, int epoll_fd);
struct peer {
enum peer_type {
PEER_BACKEND,
PEER_CLIENT,
} type;
int fd;
peer_event_handler event_handler;
};
void peer_epoll_add(struct peer *, int, uint32_t);
void peer_epoll_del(struct peer *, int);
//////// buf