[erlang-questions] UDP Broadcast

Ahmed Omar spawn.think@REDACTED
Wed Apr 27 22:22:19 CEST 2011


Why do you need to close and open the socket again? Why don't you just do
gen_udp:open(6000, [binary, {broadcast, true},{active, false}]).
?


On Wed, Apr 27, 2011 at 9:52 PM, Bob Cowdery <bob@REDACTED>wrote:

> 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
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>



-- 
Best Regards,
- Ahmed Omar
http://nl.linkedin.com/in/adiaa
Follow me on twitter
@spawn_think <http://twitter.com/#!/spawn_think>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110427/5f09d850/attachment.htm>


More information about the erlang-questions mailing list