Skip to content

Instantly share code, notes, and snippets.

@siygle
Created November 30, 2011 10:51
Show Gist options
  • Select an option

  • Save siygle/1408646 to your computer and use it in GitHub Desktop.

Select an option

Save siygle/1408646 to your computer and use it in GitHub Desktop.
dnode pass function call
// server side
var dnode = require('dnode');
var server = dnode({
zing: function (n, cb) { cb(n*100) }
});
server.listen(5050);
// client side
var dnode = require('dnode');
dnode.connect(5050, function(remote){
remote.zing(66, function(n){
console.log('n = ' + n);
});
});
// node client.js
// n = 6600
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment