Questions tagged [dnode]

DNode is an asynchronous object-oriented RPC system for node.js that lets you call remote functions.

(From the Readme at DNode on Github)

DNode works over network sockets and even in the browser with socket.io.

Plus, there are dnode implementations for perl, ruby, and java, so you can glue together all your backend processes swimmingly.

How it Works

When you throw an object at dnode, a recursive traversal scrubs out all of the function objects nested in your data structure and a secondary data structure is sent along with remote requests that creates shim functions that create RPC calls back to the side where the functions were originally defined.

When you call a remote function, the same recursive traversal trick happens to the arguments you pass along, so you can pass callbacks to your remote functions that actually call you back over the wire when the remote side calls the shim function on the other end.

Basically, dnode lets you call remote functions as if they were defined locally without using eval() or Function.prototype.toString().

The only catch is that because the function calls are traveling down the high-latency network, the return values of your functions are ignored. Use continuation-passing style instead!

More features:

  • symmetric design: both sides of the connection can host up methods for the other side to call

  • use tcp streams or websockets courtesy of socket.io! (see below, just throw a webserver at listen())

read more

37 questions
45
votes
3 answers

What is the difference between dnode and nowjs?

How do the two compare to each other?
blueberryfields
  • 45,910
  • 28
  • 89
  • 168
13
votes
1 answer

Inter-child-process communication options in node.js cluster

So I'm working on a node.js game server application at the moment, and I've hit a bit of a wall here. My issue is that I'm using socket.io to accept inbound connections from game clients. These clients might be connected to one of several Zones or…
Brian
  • 3,013
  • 19
  • 27
5
votes
1 answer

Send message from server to client with dnode

A couple of month ago I discovered nowjs and dnode and finally used nowjs (and https://github.com/Flotype/nowclient) for client / server bidirectional communication. nowclient enables nowjs communication between 2 node processes (instead of…
Luc
  • 16,604
  • 34
  • 121
  • 183
4
votes
1 answer

Does dnode have authentication middleware?

I'm building an express app that uses everyauth and would like to use dnode. I want to be able to use the req.loggedIn boolean set up, but for dnode rpc calls. Can this be done by having dnode listen to express? Can it access express middleware…
fancy
  • 48,619
  • 62
  • 153
  • 231
4
votes
1 answer

Php -> Node.js transport/bridge

Tell me, please, how to organize a correct transport data from PHP to Node.js? I tried to use the library dNode, but it does not work in conjunction with socket.io. Example: io.sockets.on('connection', function(socket) { var server = dnode({ …
RomanGor
  • 3,835
  • 2
  • 19
  • 26
4
votes
2 answers

Is it possible to create peer-to-peer connections in different network?

I want to create peer-to-peer connections between 2 nodejs client. using websocket (dnode) here is the limit: nodejs client run at 2 pc which is in different network. they don't have static ip (192.168.1.100 && 192.168.2.200) behind NAT or…
atian25
  • 4,166
  • 8
  • 37
  • 60
3
votes
1 answer

Syncing dnode and Express authentication - How?

I'm building a web app with Express and dnode and I'm trying to synchronize authentication between the two. I found the following example, but the sessionCheck event doesn't appear to be firing on the connection object:…
MateodelNorte
  • 1,282
  • 11
  • 21
3
votes
4 answers

Failed to rebuild dependencies with npm

As I am trying to push my nodejs app which is working fine locally to heroku, here is what I get in terminal: dcaclab@ubuntu:~/RubymineProjects/nodejs_consumer$ git push heroku master Counting objects: 1417, done. Compressing objects: 100%…
simo
  • 23,342
  • 38
  • 121
  • 218
3
votes
1 answer

Install DNode on Windows

I am trying to install DNode on Windows 7 64bit, Microsoft Visual C++ 2010 Express and Python 2.7.3 are installed. I get the following output from npm: C:\Program Files\nodejs>npm install dnode npm http GET https://registry.npmjs.org/dnode npm http…
Udo VV
  • 63
  • 1
  • 6
2
votes
1 answer

What's the most scale-friendly way to allow one node process to communicate between its own modules?

I've built a system whereby multiple modules are loaded into an "app.js" file. Each module has a route and schema attached. There will be times when a module will need to request data from another schema. Because I want to keep my code DRY, I want…
John Hamelink
  • 1,036
  • 2
  • 15
  • 33
2
votes
2 answers

Return the last element in the node list

I currently have the following Node List: {3,2,5,6,2,5} When I invoke: trailer.getPrev() the output is 2. The problem is I want to return 5, how do I do this. I have tried: return trailer; but then I get an error: The trailer node is not a valid…
Soler Mani
  • 301
  • 3
  • 5
  • 15
2
votes
2 answers

Serving client-side DNode library - "cannot find module dnode/web"

I'm trying to build a simple bidirectional DNode app using the DNode tutorial here. However I'm not sure how to serve the client-side dnode js. The example includes the following code: var js = require('dnode/web').source(); var httpServer =…
ty.
  • 10,924
  • 9
  • 52
  • 71
2
votes
2 answers

How do i make multiple Dnode connections?

I'm doing an autocomplete input form and i want to send what my user types to a remote database for suggestions. I use dnode for it now, and i do not want to do a new remote connect each time my user types so i made the remote function global like…
Ludvig
  • 637
  • 6
  • 18
2
votes
1 answer

TCP socket + socket.io bidirectional (JSON-)RPC: dnode?

I'm looking for a way to implement a bidirectional RPC in node.js (means that both client and server provide remote-callable procedures, preferable like json-rpc). It should be usable on top of socket.io and TCP/IP sockets for clients. I was about…
Eliasdx
  • 2,190
  • 2
  • 23
  • 33
2
votes
2 answers

Why Node.js function doesn't return JSDom serializeDocument result?

I have PHP script which acts as a DNode client. Then I have Node.js Dnode server which evaluates code which receives from PHP client and it returns DOM as HTML. However, Node.js acts strangely to me (beeing a Node.js newbie). It doesn't return…
Frodik
  • 14,986
  • 23
  • 90
  • 141
1
2 3