Multicast in node.js?

1,864 views
Skip to first unread message

Bry

unread,
Aug 27, 2011, 8:41:12 PM8/27/11
to nod...@googlegroups.com
Hello guys,

anyone got an example of multicast udp in node.js? Ive been looking at the api but it really isn't documented very well. it doesn't have to be a full example, just a starting point to get my started.

Ben Noordhuis

unread,
Aug 27, 2011, 9:12:50 PM8/27/11
to nod...@googlegroups.com

https://github.com/joyent/node/blob/master/test/simple/test-dgram-multicast.js

The API is dirt simple really: enable/disable multicast,
enable/disable loopback, join/leave a multicast group - that's it.

Bry

unread,
Aug 27, 2011, 9:19:08 PM8/27/11
to nod...@googlegroups.com
Very nice. I'm still a newb at all this. You know the socket.io broadcast function that sends a message to all participants. is that multicast or is it just a loop through all clients calling the send function individually? Thanks.

Ben Noordhuis

unread,
Aug 27, 2011, 9:29:04 PM8/27/11
to nod...@googlegroups.com

The latter. IPv4 multicast doesn't work outside of local networks.

Chris Dew

unread,
Aug 30, 2011, 10:52:42 AM8/30/11
to nodejs
You could have a look at this module which wraps multicast into a LAN-
wide event emitter:

https://github.com/chrisdew/multicast-eventemitter

All the best,

Chris.
Reply all
Reply to author
Forward
0 new messages