diff options
Diffstat (limited to 'server.c')
-rw-r--r-- | server.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/server.c b/server.c deleted file mode 100644 index 8525689..0000000 --- a/server.c +++ /dev/null @@ -1,40 +0,0 @@ -#include <netinet/in.h> -#include <sys/socket.h> -#include <arpa/inet.h> -#include <strings.h> -#include <stdlib.h> -#include <stdbool.h> -#include <stdio.h> -#include <sys/types.h> -#include <unistd.h> -#include <sys/epoll.h> -#include <errno.h> - -#include "evloop.h" -#include "tsocket.h" -#include "util.h" -#include "acceptor.h" -#include "tpool.h" - -int main() -{ - evloop_t *el = evloop_create(); - if (el == NULL) - panic("eventloop creation"); - - struct tsocket *sock = tsocket_create(); - if (sock == NULL - || tsocket_bind(sock, "127.0.0.1", 8888) == -1 - || tsocket_listen(sock) == -1) - panic("socket creation"); - - tpool = tpool_create(0); - if (!tpool) - panic("tpool_create"); - - event_t *acceptEvent = conn_acceptor_create_event(sock, el); - if (evloop_add(el, acceptEvent, EPOLLIN) == -1) - panic("eventloop add fd"); - - evloop_loop(el); -} |