[erlang-questions] UDP Broadcast

Bob Cowdery bob@REDACTED
Wed Apr 27 22:57:41 CEST 2011


I must admit I hadn't tried that because I read that a broadcast socket
could not be used to listen on. However, if it can that would solve the
issue.


On 27/04/2011 21:22, Ahmed Omar wrote:
> 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
> <mailto: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 <mailto: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/#%21/spawn_think>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110427/7aaf9b68/attachment.htm>


More information about the erlang-questions mailing list