The following client and server UDP broadcast code works on fine when both are on the same PC. However when I have them on separate PC\'s in the same WIFI LAN nothing happe
To actually broadcast you must send the packet to all the IP on the LAN. The range of possible IP is from 0.0.0.0 to 254.254.254.254 but to select all of them you could write: 255.255.255.255. But most of the routers will block this. They will allow something like 192.168.1.255 witch broadcasts to all the 255 ip from 192.168.1.0 to 192.168.1.254 which is what you need, I think.
Is hostname localhost? If so, you can not reach other pc. You must change it with target IP address.