【问题标题】:gdbus-monitor - interface `<none>`gdbus-monitor - 接口`<none>`
【发布时间】:2013-08-21 14:57:39
【问题描述】:

gdbus-monitor中的接口&lt;none&gt;输出有特殊含义吗?

使用GDbus 创建这样的消息需要什么API 调用(g_dbus_connection_register_object 不允许将NULL 作为GDBusInterfaceInfo * 传递,这似乎是唯一将对象注册到路径的方法)

相关:dbus - register object to remote on interface NULL

【问题讨论】:

    标签: glib dbus gdbus


    【解决方案1】:

    查看dbus-monitorsource code 表明它会在DBUS_EXPORT const char * dbus_message_get_interface ( DBusMessage * message ) 返回NULL 时立即发生(这是有效的!but not according to the spec which requires minimum one . and two name chunks!! 编辑: 一个值得注意的例外是方法不需要设置消息的接口字段的调用http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-types)。


    g_dbus_message_new_method_call (...) 允许 interface_ 为空。但这仍然只能解决一半的问题(发件人)。 interface_s 是 NULL 的接收器方法似乎不存在。


    原来这是一个错误,我做了源代码调查并提交了一个错误(包括修复)https://bugzilla.gnome.org/show_bug.cgi?id=706675

    【讨论】:

      【解决方案2】:

      客户端在订阅 g_dbus_connection_signal_subscribe 任何信号时需要知道接口名称,否则它将侦听所有接口,因此效率低下。 需要接口来绑定服务器自省 xml 文件中提到的单个实体中的方法和信号。

      【讨论】:

      • a) 这个问题已经超过 1.5 年了,为什么现在回答 b) 一个既不能解决也不能解释根本原因的答案。
      猜你喜欢
      • 1970-01-01
      • 2022-09-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多