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

Support server/peer-to-peer mode #36

Open
amezin opened this issue Jul 12, 2021 · 2 comments
Open

Support server/peer-to-peer mode #36

amezin opened this issue Jul 12, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@amezin
Copy link

amezin commented Jul 12, 2021

See https://developer.gnome.org/gio/stable/GDBusServer.html

Processes can use D-Bus protocol to talk directly to each other, without a bus.

But in the current code DBusServerBase's __init__ (and then all of its subclasses) has "bus type" and "name" parameters that both don't exist in server/peer-to-peer mode.

@amezin amezin changed the title Support server mode Support server/peer-to-peer mode Jul 12, 2021
@FFY00
Copy link
Owner

FFY00 commented Jul 12, 2021

Does jeepney support this? I don't think so, right?

The bus argument should be made optional and keyword-only, and then we add whatever arguments we need to support peer-to-peer mode.

@FFY00 FFY00 added the enhancement New feature or request label Jul 12, 2021
@amezin
Copy link
Author

amezin commented Jul 12, 2021

Does jeepney support this? I don't think so, right?

No, it does. At least, from the code it looks so.

class DBusConnection:
...
    def __init__(self, reader: asyncio.StreamReader, writer: asyncio.StreamWriter)

jeepney's asyncio.DBusConnection can be created from an arbitrary reader/writer pair (and, luckily, it also skips typical bus connection steps). So I can create it from any socket/pipe I want.

What's the point of storing bus and name?

By the way, acquiring a (well-known) bus name isn't necessary for exporting objects, even when connecting to a bus (they will be available under connection's unique name).

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

No branches or pull requests

2 participants