In message <[EMAIL PROTECTED]>
          Stuart Auchterlonie <[EMAIL PROTECTED]> wrote:

> Looks like there is a small problem with the way you have
> set the timeout for the select loop.
> 
> struct timeval select_timeout = { 0, (timeout_ms) % 1000 };
> 
> The second component of the timeout is measured in usecs,
> so when you are passing in 5000 you get a 5usec timeout.

That' a mod operator, so it's actually a zero second timeout...

> No quite what you had in mind. This is probably more like it.
> 
> struct timeval select_timeout = { 0, (timeout_ms) * 1000 };

Except that values over a second should go in the first element
so something like this:

  struct timeval select_timeout = { timeout_ms / 1000,
                                   (timeout_ms % 1000) * 1000 };

Tom

-- 
Tom Hughes ([EMAIL PROTECTED])
http://www.compton.nu/
_______________________________________________
mythtv-dev mailing list
[email protected]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

Reply via email to