Re: Suggestions for my Linux app...?

On 2007-01-17, trashman.horlicks@xxxxxxxxxxxxxx <trashman.horlicks@xxxxxxxxxxxxxx> wrote:
Like this?

struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = 200000; /* 0.2 seconds */
select (0, NULL, NULL, NULL, &tv);

that'd work.

usleep(200000) would have the same effect.

nanosleep would be another option. (usleep is easier to use)

If it's for a server typically you use select and list put the FD of all the
sockets you're listening on in the readfds... and any with writes pending
in the writefds