+ for (;;)
+ {
+ struct timeval tv = { 0, 100000 };
+
+
+ FD_ZERO (&rfd);
+ FD_ZERO (&wfd);
+
+ tty_pre_select (c.t, &rfd);
+ tty_pre_select (a.terminal, &rfd);
+
+ socket_pre_select (s, &rfd, &wfd);
+
+ client_pre_select (clients);
+
+ select (FD_SETSIZE, &rfd, NULL, NULL, &tv);
+
+ cs = socket_post_select (s, &rfd, &wfd);
+
+ if (cs)
+ {
+ /*New client connexion */
+ clients_new (clients, cs, c);
+ }
+
+ clients_post_select (clients, c, &rfds, &wfds);
+
+ if (FD_ISSET (c->t->rfd, &rfds))
+ {
+ char buf[1024];
+ int red;
+
+ red = c->t->recv (c->t, buf, sizeof (buf));
+
+ if (red < 0)
+ break;