diff options
author | Guangxiong Lin <[email protected]> | 2022-12-09 16:46:49 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2022-12-09 19:39:08 +0800 |
commit | 49839c88a98d3798f7b18c58f54f26f36cacff38 (patch) | |
tree | 5cb4ee13f9bdb0ef25e39a07a628f6f16da18e87 /tsocket.h | |
parent | 0457119acb36b89b6f2f4534fe8ad94b19540bbd (diff) | |
download | tinyserver-49839c88a98d3798f7b18c58f54f26f36cacff38.tar.gz tinyserver-49839c88a98d3798f7b18c58f54f26f36cacff38.tar.bz2 tinyserver-49839c88a98d3798f7b18c58f54f26f36cacff38.zip |
Implement a simple thread pool and refactor
Refactor
Diffstat (limited to 'tsocket.h')
-rw-r--r-- | tsocket.h | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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 |