Split out peer

This commit is contained in:
Ian Gulliver
2016-02-22 16:49:43 -08:00
parent b5219d9c1a
commit b5ab0cb0a6
12 changed files with 119 additions and 99 deletions

View File

@@ -1,22 +1,6 @@
#pragma once
#include <stdint.h>
#include <sys/epoll.h>
//////// peer
// All specific peer structs must be castable to this.
struct peer;
typedef void (*peer_event_handler)(struct peer *);
struct peer {
int fd;
peer_event_handler event_handler;
};
void peer_init();
void peer_epoll_add(struct peer *, uint32_t);
void peer_epoll_del(struct peer *);
void peer_loop();
//////// packet