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 --- tsocket.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tsocket.h') diff --git a/tsocket.h b/tsocket.h index 5a8826c..5028b04 100644 --- a/tsocket.h +++ b/tsocket.h @@ -8,11 +8,12 @@ struct tsocket { const char *addr; int port; }; +typedef struct tsocket tsocket_t; -struct tsocket *tsocketNew(); -int tsocketBind(struct tsocket *sock, const char *addr, int hostport); -int tsocketListen(struct tsocket *sock); -struct tsocket *tsocketAccept(struct tsocket *sock); -void tsocketDelete(struct tsocket *sock); +struct tsocket *tsocket_create(); +int tsocket_bind(struct tsocket *sock, const char *addr, int hostport); +int tsocket_listen(struct tsocket *sock); +struct tsocket *tsocket_accept(struct tsocket *sock); +void tsocket_destroy(struct tsocket *sock); #endif -- cgit v1.2.3