[erlang-questions] udp multicast: problem with OSX?

Peter Morgan peter.james.morgan@REDACTED
Tue Apr 12 17:48:14 CEST 2016


Hi Radek,

Thanks - Yes, I have had multicast working previously on OSX and Linux way back somewhere in 2011 with https://github.com/shortishly/mdns.

I had some trouble compiling gossiperl - I tried with R18 but the rebar.config needed R17, when I tried with R17 one of the dependencies required R18. Do you have another branch that I missed?

My issue seems to be that I can receive multicast on OSX, but I cannot send…

Thanks
Peter.


> On 7 Apr 2016, at 15:39, Rad Gruchalski <radek@REDACTED> wrote:
> 
> Hi Peter,
> 
> Multicast works absolutely fine on OSX. Here is how multicast is enabled:
> https://github.com/gossiperl/gossiperl/wiki/multicast-overlays#setting-up-multicast-on-os-x <https://github.com/gossiperl/gossiperl/wiki/multicast-overlays#setting-up-multicast-on-os-x>
> 
> And then using the multicast options:
> https://github.com/gossiperl/gossiperl/blob/master/include/gossiperl.hrl#L107 <https://github.com/gossiperl/gossiperl/blob/master/include/gossiperl.hrl#L107>
> 
> Works perfect on Linux, OSX and RPi.
> 
> 
> 
> Best regards,
> 
> Radek Gruchalski
> 
> radek@REDACTED <mailto:radek@REDACTED>
>  <mailto:radek@REDACTED>
> de.linkedin.com/in/radgruchalski/ <http://de.linkedin.com/in/radgruchalski/>
> 
> Confidentiality:
> This communication is intended for the above-named person and may be confidential and/or legally privileged.
> If it has come to you in error you must take no action based on it, nor must you copy or show it to anyone; please delete/destroy and inform the sender immediately.
> On Thursday, 7 April 2016 at 16:14, Peter Morgan wrote:
> 
>> Hello -
>> 
>> I’m having some trouble getting UDP multicast working on OSX, whereas the same code on Linux works fine.
>> 
>> On linux (fedora 23):
>> 
>> [pmorgan@REDACTED ~]$ erl
>> Erlang/OTP 18 [erts-7.3] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]
>> 
>> Eshell V7.3 (abort with ^G)
>> 1> Address = {224, 0, 0, 251}.
>> {224,0,0,251}
>> 2> Port = 5353.
>> 5353
>> 3> {ok, Socket} = gen_udp:open(Port, [binary, {ip, Address}, {add_membership, {Address, {0,0,0,0}}}, {reuseaddr, true}]).
>> {ok,#Port<0.543>}
>> 4> gen_udp:send(Socket, Address, Port, <<"hello world">>).
>> ok
>> 
>> 
>> Whereas on OSX:
>> 
>> Office-iMac:mdns pmorgan$ sw_vers
>> ProductName:	Mac OS X
>> ProductVersion:	10.11.4
>> BuildVersion:	15E61b
>> 
>> Office-iMac:mdns pmorgan$ erl
>> Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
>> 
>> Eshell V7.3 (abort with ^G)
>> 1> Address = {224, 0, 0, 251}.
>> {224,0,0,251}
>> 2> Port = 5353.
>> 5353
>> 3> {ok, Socket} = gen_udp:open(Port, [binary, {ip, Address}, {add_membership, {Address, {0,0,0,0}}}, {reuseaddr, true}]).
>> {ok,#Port<0.553>}
>> 4> gen_udp:send(Socket, Address, Port, <<"hello world">>).
>> {error,eaddrnotavail}
>> 
>> 
>> I’ve tried various other options in gen_udp:open/2, but not found a combination that works for OSX. Any ideas please? The above is a simplified test case of https://github.com/shortishly/mdns/blob/master/src/mdns_udp.erl#L41-L49 <https://github.com/shortishly/mdns/blob/master/src/mdns_udp.erl#L41-L49>
>> 
>> Thanks,
>> Peter.
>> 
>> 
>> 
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
>> http://erlang.org/mailman/listinfo/erlang-questions <http://erlang.org/mailman/listinfo/erlang-questions>

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


More information about the erlang-questions mailing list