[erlang-questions] Multicast UDP and Linux

Rob Elsner thatsnotright@REDACTED
Tue Jun 9 19:44:55 CEST 2009


Sergej,

> This is what I use for multicast. Dest, Source are IP address tuples.
>
> {ok, Sock} = gen_udp:open(P#tspar.src_port, [{reuseaddr,true}, {ip, Source},
> {multicast_ttl, P#tspar.ttl}, {multicast_loop, false}, binary]),
> inet:setopts(Sock, [{add_membership, {Dest, Source}}]);

for the first Source in gen_udp:open, this has to be a local IP
otherwise an eaddrnotavail is returned.

I've been reading around about the IGMPv3 support in Linux, and it
looks like there was a source IP address added to the structure  but I
cannot find reference to this in the erlang source.

Rob


More information about the erlang-questions mailing list