UDP Broadcast in Windows 7 - does it work?
问题 I'm trying to write some code under Windows 7 to broadcast across my local network and can't get the following code to work. I come from a Linux background so apologies for style - the full code compiles etc and works and if I use an address of: unsigned long broadcastAddr = inet_addr("192.168.10.0") | ~(inet_addr("255.255.240.0")); Then that works fine, I just would really like to use the preferred INADDR_BROADCAST/255.255.255.255 method. <snip> SOCKET sockfd; int broadcast = 1; WSADATA