aboutsummaryrefslogtreecommitdiff
path: root/handler.c
diff options
context:
space:
mode:
Diffstat (limited to 'handler.c')
-rw-r--r--handler.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/handler.c b/handler.c
index ffd37dd..f400f2b 100644
--- a/handler.c
+++ b/handler.c
@@ -179,14 +179,20 @@ static int remove_client_from_list(struct handler *const h,
return ret;
}
-int handler_listen(struct handler *const h, const unsigned short port)
+int handler_listen(struct handler *const h, const unsigned short port,
+ unsigned short *const outport)
{
- if (!(h->server = server_init(port)))
+ if (!(h->server = server_init(port, outport)))
{
fprintf(stderr, "%s: server_init failed\n", __func__);
return -1;
}
+ return 0;
+}
+
+int handler_loop(struct handler *const h)
+{
for (;;)
{
bool exit, io;