select on udp recvfrom doesn't work ???

Dave Cramer davec-zxk95TxsVYDyHADnj0MGvQC/G2K4zDHf at public.gmane.org
Tue Aug 10 21:50:02 UTC 2010


On Tue, Aug 10, 2010 at 5:29 PM, Lennart Sorensen
<lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org> wrote:
> On Tue, Aug 10, 2010 at 05:25:03PM -0400, Dave Cramer wrote:
>> Is there some reason that doing using select does not see the data
>> coming to a udp socket that is not connected, but is bound and is
>> listening.
>>
>> I am broadcasting data to the socket. I have confirmed that if I don't
>> use select that it receives data.
>>
>> What I am trying to do is synchronize multiple linux embedded systems
>> to within 10ms. My thought is to use a UDP broadcast to start the
>> synchronization then use the internal clocks. If anyone has any
>> interesting ideas I'm open to suggestions.
>
> Have you heard of ntp?  It does just that, and way more accurately,
> and is done by people that understand time synchronization.  Don't try
> to reinvent a wheel, when you don't know how a wheel works.
>

That was pleasant .... if ntp worked I would use it. Yes it will
synchronize the clocks but then what do you do.

Lets say you want to do something on the same  125ms on multiple
machines. Your first problem is getting a starting point. One would
think you could just do gettimeofday until you get to the 0th
millisecond of the second, however you quickly find out that
gettimeofday can't be called that quickly. So how do you set the start
point ? I have thought about this a little more than your flippant
response.

Dave
> --
> Len Sorensen
> --
> The Toronto Linux Users Group.      Meetings: http://gtalug.org/
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
>
>
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list