udp broadcasts

Alan Cox alan@lxorguk.ukuu.org.uk
Wed, 24 Mar 1999 12:29:51 +0000 (GMT)


> can anyone tell me or point me towards resources on how to LISTEN for
> broadcast messages? I'm searching the web and waiting for a couple of
> books to arrive, but any additional hints would be great.
> I've never used broadcasts before. :-/

Listening is easy, just create a UDP socket on that port and then bind it
to INADDR_ANY. You'll get local host directed and also broadcast frames.
If you use recvfrom() you can even tell them aaprt