From e339f2d269fcaffed7beed67c3995fe3b67393eb Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Sat, 17 Dec 2022 21:24:04 +0800 Subject: Support on_connect function in server lib --- src/connection.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/connection.h') diff --git a/src/connection.h b/src/connection.h index 4e14487..ce39a7c 100644 --- a/src/connection.h +++ b/src/connection.h @@ -7,9 +7,13 @@ struct connection; typedef struct connection connection_t; +typedef void (*connection_callback_func_t)(connection_t *conn); + connection_t *connection_create(struct tsocket *sock); void connection_destroy(struct connection *conn); -event_t *connection_create_event(struct tsocket *sock); +event_t *connection_event_create(struct tsocket *sock, connection_callback_func_t func); + +int connection_fd(connection_t *conn); #endif -- cgit v1.2.3