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

Rad Gruchalski radek@REDACTED
Thu Apr 7 16:39:26 CEST 2016


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

And then using the multicast options:
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
>  
> Thanks,
> Peter.
>  
>  
>  
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED (mailto:erlang-questions@REDACTED)
> http://erlang.org/mailman/listinfo/erlang-questions
>  
>  


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


More information about the erlang-questions mailing list