Re: [dev] [st] Removing timeouts in main loop

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Sun, 16 Sep 2012 13:19:54 +0200

> Maybe a way to improve my patches is testing is some data can be read from
> the file descriptors and in this case continue the loop. something like:
>

> if(i++ < 4) {
> struct timeval tv = {0};
> FD_ZERO(&rfd);
> FD_SET(cmdfd, &rfd);
> FD_SET(xfd, &rfd);
> if(select(MAX(xfd, cmdfd)+1, &rfd, NULL, NULL, &tv) > 0)
> goto repeat;
> }
> i = 0;

Uhmmm, this is not a good idea, because it is pretty similar than
increase the input buffer by 4.
Received on Sun Sep 16 2012 - 13:19:54 CEST

This archive was generated by hypermail 2.3.0 : Sun Sep 16 2012 - 13:24:04 CEST