[erlang-questions] UDP Broadcast

Bob Cowdery bob@REDACTED
Wed Apr 27 21:52:33 CEST 2011


I don't think this is an Erlang issue. I'm probably just doing it wrong.
Any advice would be gratefully received.

My app does a UDP broadcast and expects a reply from a piece of
hardware. As I understand broadcast it involves opening a broadcast socket.

    gen_udp:open(6000, [binary, {broadcast, true}])

doing the broadcast. Then closing the socket and opening a listening socket.

    gen_udp:open(6000, [binary, {active, false}])

I've had the application working against a simulator, but the hardware
is a lot faster. Using wireshark I can see my broadcast go and the reply
come back. The problem is I miss the reply because by the time I close
the socket and open a new one its too late. I can't help feeling I must
be doing something fundamentally wrong here or broadcasts just wouldn't
work.

Thanks
Bob



More information about the erlang-questions mailing list