First let me state that I'm not sure if this is an OSX issue or I'm leaving something out:
Goal I need to specify an interface adapter to use for UDP communications to avoid conflict with other software using the same port. ( Will have 2 network adapters).
Problem: Not receiving broadcast messages when interface adapter is specified with {ip,Address} option in gen_udp
But it works as expected when I don't use the {ip,Address} option. I receive the broadcast messages sent to 255.255.255.255 or 192.168.1.255 (both work).
{ok,Socket} = gen_udp:open(Port,[{broadcast, true},{reuseaddr, true}]).
Once I add the {ip,Address} option to specify which interface adapter to use it stops receiving broadcast. I can see the message via wireshark but the socket does not receive them.
{ok,Socket} = gen_udp:open(Port,[{broadcast, true},{reuseaddr, true},{ip,Address}]).
I noticed in the case where no {ip,Address} option is used, the Socket has an Address of {0,0,0,0}. via inet:sockname(Socket).
What am I missing??