Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme Low level messaging: bus connection example error #94

Open
JetForMe opened this issue Oct 16, 2015 · 8 comments
Open

Readme Low level messaging: bus connection example error #94

JetForMe opened this issue Oct 16, 2015 · 8 comments

Comments

@JetForMe
Copy link
Contributor

The docs talk about "dbus.createClient(options)", but the example shows "dbus.createConnection()."

@sidorares
Copy link
Owner

oops. Do you know which one is correct ( don't have time to read through code right now )

@sidorares
Copy link
Owner

Any improvements to documentations are very much welcome, if you find time adding something please submit PR

@JetForMe
Copy link
Contributor Author

Yeah, I don't know which is correct! I'm trying some experiments now. I'm having some issues getting DBus to play nicely in all of a handful of configurations, so I was trying some changes. I think createConnection() is right.

@sidorares
Copy link
Owner

they both are correct, that was probably not a good choice of names

https://github.com/sidorares/node-dbus/blob/master/index.js#L129-L132

'connection' is for low level messaging - conn.message({...}) and conn.on('message, ...)'

'client' handles RPC-style calls by remembering association from serial/replySerial to callback

@sidorares
Copy link
Owner

and you can always access connection from a client:

var bus = require('dbus-native').systemBus(); // "client"
bus.connection.message({ body: 'hello', signature: 's'}); 

@JetForMe
Copy link
Contributor Author

Heh. I find this all very confusing. I'm using DBus to communicate between a C++ app and my node.js app, on both OS X and Debian. During development, I want to be able to launch one or the other, or both, in any order, and I want them to quickly connect or abandon a connection attempt and connect later. I wish I could do this without dbus-daemon running at all, but that doesn't seem to be the case.

@sidorares
Copy link
Owner

this module allows to communicate directly - you could pretend that you are daemon and point C++ app to your node app by setting DBUS_SESSION_BUS_ADDRESS

@JetForMe
Copy link
Contributor Author

But it seems I have to create a socket somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants