aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tcp_server.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/tcp_server.h')
-rw-r--r--src/tcp_server.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/tcp_server.h b/src/tcp_server.h
index 0f377d8..f96e3f1 100644
--- a/src/tcp_server.h
+++ b/src/tcp_server.h
@@ -8,12 +8,17 @@
#ifndef __TCP_SERVER_H__
#define __TCP_SERVER_H__
+#include "event_loop.h"
+
struct tcp_server;
-int tcp_server_create(struct tcp_server **, const char *port);
+typedef int (*tcp_server_conn_handler)(int conn_fd, void *arg);
+
+int tcp_server_create(struct tcp_server **, const char *port, tcp_server_conn_handler, void *arg);
void tcp_server_destroy(struct tcp_server *);
-typedef int (*tcp_server_conn_handler)(int conn_fd, void *arg);
-int tcp_server_accept(const struct tcp_server *, tcp_server_conn_handler, void *arg);
+int tcp_server_accept(const struct tcp_server *);
+
+int tcp_server_add_to_event_loop(struct tcp_server *, struct event_loop *);
#endif