> -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf > Of Herbert Graf > Sent: 10 January 2006 17:17 > To: Microcontroller discussion list - Public. > Subject: RE: [EE] Receiving broadcast UDP packets > > On Tue, 2006-01-10 at 16:21 +0000, Peter Onion wrote: > > > I've set SO_BROADCAST with set_sockopt but it didn't improve things. > > > > I think that only applies to sending to the broadcast address. > > Hmm, see, there was some conflicting information on that. Some man pages > send it was for reception and transmission, others just for > transmission. Thanks for the clearing that one up! > > > > Is there a trick to enabling the reception of broadcast packets? > > > > Set the bind address to INADDR_BROADCAST > > > > Name.sin_family = AF_INET; > > Name.sin_addr.s_addr = INADDR_BROADCAST; > > Name.sin_port = htons(potrNumber); > > > > Bind(rxSocket,(struct sockaddr *) &Name,sizeof(name)); > > Hmm, odd, that's the last thing I tried, to no avail. Is it possible > that INADDR_BROADCAST only responds to certain broadcast addresses, i.e. > 192.168.1.255 but NOT 255.255.255.255? Yes I think that's right (and what I would expect). If your device is really sending to 255.255.255.255 I think it is misconfigured ! It SHOULD be sending to the broadcast address for the subnet to which it belongs (i.e. 192.168.1.255) ! I'm not sure that 255.255.255.255 is even a valid broadcast address ? > > Have you seen a small example that you were able to get working? I don't have a "small example", but that code was taken from a working application that uses broadcast udp packets to find other versions of it self running on the local network. Peter > Thanks for the help. TTYL > > ----------------------------- > Herbert's PIC Stuff: > http://repatch.dyndns.org:8383/pic_stuff/ > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist