multicast join problems (source specific)

Mark Geib <[email protected]>
Newsgroups gmane.comp.lang.erlang.general
Message-ID <[email protected]>
I have a problem when joining more than one source specific multicast group. The first gen_udp:open() works as expected, I start receiving datagrams sent to the specified multicast address, and coming from the specified source. However, in another gen_server if I try to do the same, but on a different multicast and source address, I start receiving the datagrams on both the new socket as well as the first socket and from both multicast groups. The open looks like:

Port = 3100,
Bin = << <<239,0,0,1>>/binary, <<0,0,0,0>>/binary, <<10,0,1,1>>/binary >>,
{ok, _Socket} = gen_udp:open(Port,
                             [binary,
                              {active, true},
                              {reuseaddr, true},
                              {multicast_ttl, 30},
                              {raw, 0, 39, Bin}]), %% 0 - IPPROTO_IP, 39 - IP_ADD_SOURCE_MEMBERSHIP

I am able to join multiple multicasts, non source specific, and receive only datagrams from the correct group by using an open like:

Port = 3100,
{ok, _Socket} = gen_udp:open(Port,
                             [binary,
                              {active, true},
                              {reuseaddr, true},
                              {multicast_ttl, 30},
                              {add_membership, {239,0,0,1}, {0,0,0,0}}]),

Any suggestions or help would be appreciated.

Mark.
signature.asc (application/pgp-signature, 528 B)
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQEzBAEBCAAdFiEEYVHNuqOGsZElnxbO+5z0iCyWfG4FAmAF+5UACgkQ+5z0iCyW
fG7pYQgAmDQGMad+Z+CSo5o/IpOHWSSrghhv3Y/nDZU5hwdDqQ1JgCmN/x/OweHa
LSBa+EiCuabIb6skAStPlkH3Hck0ydxDxMV8cgF+R6XAABNw/DNZwVrJdAhZjsQx
WQM5O/kJmBFOgtfiPSTGCFttXv9edbeZmB7+QK77yXPT1fuRM9K5x7HnZbSigK6s
olWLTdkrekdocGxkEbpaiBScHJ8LeTLpC2Tly2fHAGFaFyJbj+f1xXtz5DCcIZ7C
2ndAFL/wpdWlAnD/4oBUvTDTJ9IKUA87QXLdbXkW5OVNFxYmV3k6c+nD673Dw9GL
2l9ob26AGpAj+R0NDOCcKRcQNE1XbQ==
=dp5g
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.