select on udp recvfrom doesn't work ???

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Wed Aug 11 16:23:40 UTC 2010


On Wed, Aug 11, 2010 at 12:14:55PM -0400, Lennart Sorensen wrote:
> > So this was a bust. The rtc on this board a ts7260 cannot generate interrupts :(
> > 
> > The chip itself has an rtc and some internal timers that could
> > generate interrupts.
> > 
> > The question still remains how to get them synchronized to the same
> > place in time. Using a udp message which would arrive roughly at the
> > same time to all devices still seems plausible ?
> 
> How about this little example.  It waits for a UDP message (anything at
> all) on port 5000, and when that happens it starts to print a message
> every 10 ticks, with a tick rate of 10ms, (so 10 times per second it
> does the print).
> 
> I start it by doing:
> 
> echo "Foo" | nc -u ipaddress 5000 -q 1
> 
> nc is netcat.  Any other udp capable network connection should work too.

By the way you can do a broadcast using something like:

echo "Foo" | nc -b -u broadcastaddress 5000 -q 0

So if your network is 192.168.1.0/24 then do:

echo "Foo" | nc -b -u 192.168.1.255s 5000 -q 0

-- 
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





More information about the Legacy mailing list