From 49839c88a98d3798f7b18c58f54f26f36cacff38 Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Fri, 9 Dec 2022 16:46:49 +0800 Subject: Implement a simple thread pool and refactor Refactor --- connection.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'connection.h') diff --git a/connection.h b/connection.h index c7b24fc..4e14487 100644 --- a/connection.h +++ b/connection.h @@ -1,15 +1,15 @@ #include "tsocket.h" -#include "eventloop.h" +#include "evloop.h" #ifndef __CONNECTION_H #define __CONNECTION_H -struct connection { - struct tsocket *sock; -}; +struct connection; +typedef struct connection connection_t; -struct connection *connectionNew(struct tsocket *sock); -void connectionDel(struct connection *conn); -struct event *connectionNewEvent(struct connection *conn); +connection_t *connection_create(struct tsocket *sock); +void connection_destroy(struct connection *conn); + +event_t *connection_create_event(struct tsocket *sock); #endif -- cgit v1.2.3