select on udp recvfrom doesn't work ???

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


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

-- 
Len Sorensen
-------------- next part --------------
ALL = timer
CFLAGS = -Wall
LDFLAGS = -lrt

all: $(ALL)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: timer.c
Type: text/x-csrc
Size: 1969 bytes
Desc: not available
URL: <http://gtalug.org/pipermail/legacy/attachments/20100811/c3d2cfb5/attachment.c>


More information about the Legacy mailing list