From 29bdedf923939be842cd61c5f7b042d4117f888e Mon Sep 17 00:00:00 2001 From: Nishi Date: Sat, 7 Sep 2024 09:25:26 +0000 Subject: [PATCH] wip git-svn-id: file:///raid/svn-personal/mokou/trunk@9 35d6bad2-6c5c-c749-ada2-a2c82cb3bd79 --- Mokou/server.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Mokou/server.c b/Mokou/server.c index 5569660..c0c0b97 100644 --- a/Mokou/server.c +++ b/Mokou/server.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -52,8 +53,12 @@ void mk_server_loop(void){ cbuf[1] = 0; char* str = malloc(1); str[0] = 0; + struct pollfd pollfds[16 + 1]; + pollfds[0].fd = server; + pollfds[0].events = POLLIN | POLLPRI; while(1){ mk_log("Waiting for the connection"); + int r = poll(pollfds, 16 + 1, 5000); int cli = accept(server, (struct sockaddr*)&cun, &socklen); send(cli, ver, strlen(ver), 0); while(1){ -- 2.43.0