创建一个由 avahi 播放的节目
我正在尝试编写一个程序,输出可以通过 avahi 网络提供的数据。我看过的文档似乎说我必须使用 dbus 注册服务,然后将其连接到 avahi,但执行此操作的文档非常稀疏。有谁知道它的良好文档吗?我一直在看这些:
python-dbus: http://dbus.freedesktop.org/doc/dbus -python/doc/tutorial.html#exporting-objects
python-avahi: http://www.amk.ca/diary/2007/04/rough_notes_python_and_dbus.html
我真的不熟悉 avahi 的工作原理,所以任何指示都会有所帮助。
I'm trying to write a program that outputs data that can be served over a network with avahi. The documentation I've looked at seems to say I have to register the service with dbus and then connect it to avahi, but the documentation to do this is pretty sparse. Does anyone know of good documentation for it? I've been looking at these:
python-dbus:
http://dbus.freedesktop.org/doc/dbus-python/doc/tutorial.html#exporting-objects
python-avahi:
http://www.amk.ca/diary/2007/04/rough_notes_python_and_dbus.html
I'm really unfamiliar with how avahi works at all, so any pointers would be helpful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我意识到这个答案已经很晚了,考虑到你的问题是四年前提出的。但是,它可能对其他人有帮助。
下面公布了一个使用 avahi/dbus 的服务:
使用 avahi-browse 来验证它确实已发布:
I realise this answer is pretty late, considering your question was asked four years ago. However, it might help others.
The following announces a service using avahi/dbus:
Using avahi-browse to verify it is indeed published:
Avahi“只是”ZeroConfig 的客户端实现,它基本上是“基于组播的 DNS”协议。您可以使用 Avahi 通过端点发布“数据”的可用性。实际数据必须通过其他方式检索,但您通常会注册一个可以通过您喜欢的方法“调用”的端点。
Avahi is "just" a Client implementation of ZeroConfig which basically is a "Multicast based DNS" protocol. You can use Avahi to publish the availability of your "data" through end-points. The actual data must be retrieved through some other means but you would normally register an end-point that can be "invoked" through a method of your liking.