Skip to content

Instantly share code, notes, and snippets.

@bnoordhuis
Created January 26, 2012 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bnoordhuis/73e659c504915d22f99f to your computer and use it in GitHub Desktop.
Save bnoordhuis/73e659c504915d22f99f to your computer and use it in GitHub Desktop.
var dgram = require('dgram');
var a = dgram.createSocket('udp4');
a.on('message', function(m) {
console.log('a received ' + m);
});
a.bind(8000, '127.0.0.1');
var b = dgram.createSocket('udp4');
b.on('message', function(m) {
console.log('b received ' + m);
});
b.bind(8000, '127.0.0.1');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment