I need to use IPv4 subnet broadcasts. The sending portion is simple and well-documented.

What I have not been able to find is information on the proper way to receive. Most of the examples just listen on 0.0.0.0 (the wildcard address), but I can't do this because I need to know which interface received the broadcast, and therefore I need to bind the listener to a particular address.

I have tried binding to subnet.255. This works on some machines but causes EADDRNOTAVAIL on others. I have tried binding to subnet.0. The broadcast does not appear to be received. I have also tried binding to a normal IP address of an interface; the broadcast does not appear to be received.

Any suggestions?