server: remove the sleep from main loop

This commit is contained in:
Shuanglei Tao
2019-11-26 21:55:42 +08:00
parent 28cbbdaa3d
commit 6d69f0a55d
2 changed files with 1 additions and 2 deletions

View File

@@ -216,7 +216,7 @@ tty_client_poll(struct tty_client *client) {
fd_set des_set;
FD_ZERO (&des_set);
FD_SET (client->pty, &des_set);
struct timeval tv = { 0, 0 };
struct timeval tv = { 0, 5000 }; // 5ms
if (select(client->pty + 1, &des_set, NULL, NULL, &tv) <= 0) return;
if (FD_ISSET (client->pty, &des_set)) {

View File

@@ -503,7 +503,6 @@ main(int argc, char **argv) {
}
}
lws_service(context, 0);
usleep(10 * 1000); // 10ms
}
lws_context_destroy(context);