gdbus-monitor - interface `<none>`

瘦欲@ 提交于 2019-12-25 07:08:02

问题


Has the interface <none> in the gdbus-monitor output a special meaning?

What API call is required to create such a message using GDbus (g_dbus_connection_register_object does not allow to pass NULL as GDBusInterfaceInfo * and that seems to be the only to register a object to a path)

related: dbus - register object to remote on interface NULL


回答1:


Looking into dbus-monitor's source code shows that it occures as soon as DBUS_EXPORT const char * dbus_message_get_interface ( DBusMessage * message ) returns NULL (which is valid!, but not according to the spec which requires minimum one . and two name chunks!! EDIT: A noteable exception are method calls which do not require the interface field of a message to be set http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-types).


g_dbus_message_new_method_call (...) allows interface_ to be null. But that still only solves half the problems (sender). The receiver method seems to not exist for interface_s being NULL.


Turns out it is a bug, I did a source code investigation and filed a bug (including fix) https://bugzilla.gnome.org/show_bug.cgi?id=706675




回答2:


client needs to know the interface name while subscribing g_dbus_connection_signal_subscribe to any signal else it will listen to all interfaces hence inefficient. Interface is required to bind methods and signals in single entity mentioned in server introspection xml file.



来源:https://stackoverflow.com/questions/18360860/gdbus-monitor-interface-none

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!