[ale] UDP Broadcasts

Alex Carver agcarver+ale at acarver.net
Fri Dec 13 02:47:19 EST 2013


Aha, select(), I forgot about that.  The little bit of socket
programming I've done was always a single server and a single client so
I never used select.  But if I end up with more than one UDP transmitter
on the network I'll want to capture packets whenever they get sent
(on-board clock puts the microcontroller to sleep then wakes every so
often to transmit the UDP data packet).

On 12/12/2013 15:35, Horkan Smith wrote:
> Yup, netcat's a very good cli for UDP and TCP.
> 
> Debian carries both netcat-openbsd and netcat-traditional, w/ netcat-openbsd having quite a bit more functionality.  od, hexdump and tcpdump will also come in handy, but aren't required.
> 
> You can 'google' (or other preferred search engine) for "stevens udp server example" to find sources, including class homework from a college course or two.
> 
> I *think* I generated these years (decades?) ago by reading the Stevens Unix networking book....  Feel free to email w/ questions; commenting is non-existent.  I would consider these educational in nature, not production ready, btw.
> 
> udpserv.c - udp server, notice the 'INADDR_ANY' on the bind, that means I'll bind to any/all interfaces and not care who sent it.  You also get an example of select() for free.... 8-)  (select() is not required, you can use the recvfrom() w/out it.)

[snip]



More information about the Ale mailing list