Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5454
  • 博文数量: 1
  • 博客积分: 1415
  • 博客等级: 上尉
  • 技术积分: 20
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-29 22:12
文章分类

全部博文(1)

文章存档

2008年(1)

我的朋友
最近访客

分类: LINUX

2008-03-29 22:12:48

D-Bus is a system for interprocess communication (IPC). Architecturally, it has several layers:

  • A library, libdbus, that allows two applications to connect to each other and exchange messages.
  • A message bus daemon executable, built on libdbus, that multiple applications can connect to. The daemon can route messages from one application to zero or more other applications.
  • Wrapper libraries or bindings based on particular application frameworks. For example, libdbus-glib and libdbus-qt. There are also bindings to languages such as Python. These wrapper libraries are the API most people should use, as they simplify the details of D-Bus programming. libdbus is intended to be a low-level backend for the higher level bindings. Much of the libdbus API is only useful for binding implementation.

D-BUS 是一种进程间通信的手段,从构架上来看,分为这几层:

  • 一个库,libdbus,允许2个进程间交换信息。
  • 一个消息总线守护进程, 多个应用进程都可以与它连接。它可以将消息从一个进程发给另外任意数量的其他进程。
  • 有一些基于特定应用框架的dbus库函数封装,例如libdbus-glib 和libdbus-qt,也有与一些语言绑定的形式,例如Python等。这些封装的API旨在另D-BUS编程更加简单,libdbus倾向于提供更低 层次的调用。很多libdbus API只在绑定的组件中可用。

libdbus only supports one-to-one connections, just like a raw network socket. However, rather than sending byte streams over the connection, you send messages. Messages have a header identifying the kind of message, and a body containing a data payload. libdbus also abstracts the exact transport used (sockets vs. whatever else), and handles details such as authentication.

libdbus仅支持一对一的连接,就像网络socket一样。你可以通过连接传递消息。消息带有一个表示消息种类的头部和一个包含数据的消息体。 libdbus也可以抽象额外的传输只用,也可处理一些细节,例如认证等。(汗!像是用金山快译翻出来的。说实话,真的不知最后一句说的是什么意思,哪位 高手指点一下?)

The message bus daemon forms the hub of a wheel. Each spoke of the wheel is a one-to-one connection to an application using libdbus. An application sends a message to the bus daemon over its spoke, and the bus daemon forwards the message to other connected applications as appropriate. Think of the daemon as a router.

消息总线守护进程构成一个轮形 hub。轮上的每个通道使用libdbus建立到应用程序一对一的连接。每个应用程序通过他的通道发送消息到消息总线,总线进程将消息转发到其他连接到hub的应用程序。可以把消息总线理解为一个路由器。

The bus daemon has multiple instances on a typical computer. The first instance is a machine-global singleton, that is, a system daemon similar to sendmail or Apache. This instance has heavy security restrictions on what messages it will accept, and is used for systemwide communication. The other instances are created one per user login session. These instances allow applications in the user’s session to communicate with one another.

总线进程在一个典型电脑上有多个实例。第一个实例是一个全局的独立进程,就像sendmail 或Apache 的系统守护进程一样。这个实例在接收消息时,有非常严格的安全限制,它一般用于系统层面的通讯。其他的实例都是由每个登录上来的会话建立的。这些实例允许 用户会话中的应用程序相互通信。

The systemwide and per-user daemons are separate. Normal within-session IPC does not involve the systemwide message bus process and vice versa.

系统和每个用户进程是独立的。通常会话IPC不会介入系统消息 ,反过来也是一样。

我的blog镜像 http://leozhang2002.blog.ubuntu.org.cn/

阅读(711) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:没有了

给主人留下些什么吧!~~