undocumented multicast

Vance Shipley <>
Thu Mar 13 21:34:26 CET 2003


On Thu, Mar 13, 2003 at 01:45:35PM +0100, Miguel Barreiro Paz wrote:
}  
}  > Can someone tell me the syntax of the undocumented multicast options? I
}  > thought I had figured it out but I still can't make it happy.  I was
}  
}  	For some strange coincidence I was doing exactly the same today
}  and having the same exact problem :-)
}  


OK, problem solved.  Actually it was solved in December of 2001:

   http://www.erlang.org/ml-archive/erlang-questions/200112/msg00068.html

I was reaching the exact same conclusion when what I was looking at 
jogged my memory.  In any event I am posting a patch against R9B-1 
to teh patches list.  Here is the (undocumented) syntax:

   gen_udp:open(9875, [{add_membership, {{224,2,127,254},{192,197,189,3}}}]).

I tested this like this:

1> compile:file(inet, [{i, "/usr/local/lib/erlang/lib/kernel-2.8.0/src"}]).
{ok,inet}
2> code:unstick_dir("/usr/local/lib/erlang/lib/kernel-2.8.0/ebin").
ok
3> code:load_file(inet).
{module,inet}
4> code:which(inet).
"/home/vances/inet.beam"
5> gen_udp:open(9875, [{add_membership, {{224,2,127,254},{192,197,189,3}}}]).
{ok,#Port<0.87>}


To verify that it works:

$ netstat -ia
Name  Mtu   Network       Address            Ipkts Ierrs    Opkts Oerrs  Coll
...
tx1   1500  192.197.189   frogman           703469     -     4233     -     -
                        SAP.MCAST.NET
                        ALL-SYSTEMS.MCAST.NET

The line SAP.MCAST.NET is mine.


	-Vance



More information about the erlang-questions mailing list