Open amezin opened 3 years ago
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.
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).
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.