+ ansi_reset (&a, NULL);
+
+ clients=clients_new();
+
+ for (;;)
+ {
+ struct timeval tv = { 0, 100000 };
+
+
+ FD_ZERO (&rfds);
+ FD_ZERO (&wfds);
+
+ tty_pre_select (c.t, &rfds,&wfds);
+ tty_pre_select (a.terminal, &rfds,&wfds);
+
+ socket_pre_select (s, &rfds, &wfds);
+
+ clients_pre_select (clients,&rfds,&wfds);
+
+ select (FD_SETSIZE, &rfds, NULL, NULL, &tv);
+
+ cs = socket_post_select (s, &rfds, &wfds);
+
+ if (cs)
+ {
+ /*New client connexion */
+ clients_new_client (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;