Created
November 30, 2011 10:51
-
-
Save siygle/1408646 to your computer and use it in GitHub Desktop.
dnode pass function call
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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