Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (15 sloc) 796 Bytes

NodeJS UDP-Multicast - API

var mdgram=require("mdgram");

Socket

var Socket = mdgram.Socket;

This is the same as for the standard Datagram Sockets, except the prototype has been enriched by 4 methods:

  • joinGroup(<Multicast-IP as a String>)
  • leaveGroup(<Multicast-IP as a String>)
  • setMulticastTTL(<TTL as an Integer between 1 and 255 (inclusive)>)
  • setMulticastInterface(<IP of a local non-looping interface as a String>)

createSocket()

var mdgram.createSocket("udp4",[<Listener Function>]);

This is the again the same as for the standard Datagram Sockets, except it creates a socket that has been enhanced by the mutlicast functions.