Home Technique D-Bus

D-Bus



Introduction

D-BUS allows the program to register it to provide services to other programs. At the same time, he also provides a client program to find which services are available. The program can also be registered to wait for the Hernel's Events such as the hardware of the hardware.

D-bus is implemented in daemon. Users can perform several D-BUS entities, each entity being referred to as a CHANNEL. Usually there is a privileged Channel called System Channel, and each user has a private entity. Users need private entities because System Channel will have access to access.

D-Bus is affected by the DCOP system and replaces DCOP in KDE 4; he has been integrated in Qt 4, Gnome, Windows, and Maemo systems. GNOME also use it to gradually replace most of the early Bonobo mechanism.

D-Bus

System Channel The main function is to deliver the HAL's message to Processes interested in these messages. The function of private entities is to provide unlimited communication between programs.

Work mode

All applications using D-Bus contain some objects, which are generally mapped to GOBJECT, QOBJECT, C ++ objects, or Python objects (may not need). An object is an instance instead of type. When a message is received via a D-BUS connection, the message is sent to an object instead of the entire application.

In order to allow the message to specify an acceptance object, it is also necessary to provide a reference to the object. In your favorite programming language, it may be called a pointer or reference. However, the above-described so-called reference is generally implemented as a memory address related to the application, so it cannot be passed between applications.

In order to solve this problem, D-bus introduces a name for each object. These names look like a file system path, such as an object, may be called "/ ORG / KDE / KSPREAD / Sheets / 3 / Cells / 4/5". Easy-to-read path name is encouraged, but also allows you to use, such as "/ COM / MyCompany / C5YO817Y0C1Y1C5B", etc., as long as it can be used for your application.

namespacing's object path begins with all the domain names of the developer (such as / org / kde) to avoid interference between the different code modules of the system.

Architecture

D-BUS is a message bus system for design aims to communicate between applications. It is a three-layer architecture process communication (IPC) system, including:

Function library libdbus, used for two application call contacts and interactive messages. A libdbus-based message, the bus daemon can be connected to multiple applications, and can route messages from one application to 0 or more other programs. A series of Wrapper libraries based on a specific application framework. D-Bus is designed for two specific circumstances:

communication of two desktop applications in the same desktop session, allows desktop sessions as a whole to solve the problem of process life cycle. The desktop session and operating system communications, where the operating system is generally included in the core and system daemon.
This article is from the network, does not represent the position of this station. Please indicate the origin of reprint
TOP