Closed jmacato closed 3 months ago
@affederaffe I've tried to "fake" it with a "multiplexing" method handler but the lower-level protocol lib does some weird stuff on PathNodes and Introspection, any ideas on this perhaps?
I implemented something similar with https://github.com/affederaffe/Tmds.DBus.SourceGenerator/commit/3c240943e0f9d4a8925513d93cfaaea932f55391. The workflow for exposing handlers now is as follows:
var connection = new Connection(Address.Session);
await connection.ConnectAsync();
var pathHandler = new PathHandler("/path/to/interfaces");
pathHandler.Add(myImplementedHandler1);
pathHandler.Add(myImplementedHandler2);
connection.AddMethodHandler(pathHandler);
Everything compiles so far, but I haven't tested it completely yet. Is that something that would work for your use-case?
@affederaffe awesome, i'll check that out now!
Okay, im testing with Avalonia master atm and i've got these errors: errordump.log
im using the latest commit on main
Okay, im testing with Avalonia master atm and i've got these errors: errordump.log
im using the latest commit on main
Caveat emptor: I've cherry picked the bumped versions of Tmds on avalonia (PR 15568)
Whoops, missed some using directives because implicit usings were on in my test project. I got Avalonia master with the changes of 15568 working (only minor changes).
@affederaffe I believe it's working now! Thank you for swiftly implementing this!
The Tmds.Dbus.Protocol.Connection class can only handle one MethodHandler at a time. Given that there are times that you need to provide multiple interfaces in the same path, is there any proper way of doing that with this sourcegen?