mirror of
https://github.com/tsl0922/ttyd.git
synced 2025-12-23 04:14:18 +01:00
server: remove the sleep from main loop
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -503,7 +503,6 @@ main(int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
lws_service(context, 0);
|
||||
usleep(10 * 1000); // 10ms
|
||||
}
|
||||
|
||||
lws_context_destroy(context);
|
||||
|
||||
Reference in New Issue
Block a user