Re: Suggestions for my Linux app...?
- From: jasen <jasen@xxxxxxxxxxx>
- Date: 18 Jan 2007 19:22:19 GMT
On 2007-01-17, trashman.horlicks@xxxxxxxxxxxxxx <trashman.horlicks@xxxxxxxxxxxxxx> wrote:
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = 200000; /* 0.2 seconds */
select (0, NULL, NULL, NULL, &tv);
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