Sophie

Sophie

distrib > Mandriva > 2011.0 > x86_64 > by-pkgid > e4e5aca55b6d7244e6bae95bf4fde3ca > files > 304

lib64edelib-devel-2.0-1.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>edelib: A short info about D-Bus</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">edelib
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">A short info about D-Bus </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h2><a class="anchor" id="dbusintro"></a>
Introduction</h2>
<p>D-Bus is an IPC (Inter Process Communication) protocol with low overhead. It is designed to unify communication between various applications, desktop environments and system properties.</p>
<p>D-Bus is a peer-to-peer and client-server protocol; this means you can communicate directly either with main daemon (<em>dbus-daemon</em>) or with some application that represents a service (then is done indirectly via dbus-daemon).</p>
<p>When you issue connection to the daemon, you will use one of two connection types:</p>
<ul>
<li>system bus</li>
<li>session bus</li>
</ul>
<p>Since D-Bus is a binary protocol, all data is marshalled into binary form and unmarshalled when receiver get it. With this binding, this is done transparently.</p>
<p>Contrary to the other IPC mechanisms and protocols, D-Bus is relatively simple one, but flexible. As you can see from <a class="el" href="classedelib_1_1EdbusData.html" title="Class for representing D-Bus data types.">edelib::EdbusData</a>, D-Bus allows various types to be send: a basic ones, like <em>int</em> or <em>char</em> and complex ones like arrays, structures or variants. With this, theoretically, you can send almost any type.</p>
<h2><a class="anchor" id="dbusconcepts"></a>
Concepts</h2>
<p>D-Bus introduces some terms and concepts. Some of them are known from other IPC systems and some of them are D-Bus related only.</p>
<h3><a class="anchor" id="dbusbus"></a>
Buses</h3>
<p>The daemon runs actual <em>bus</em>, a kind of <em>street</em> that messages are transported over, and to which any number of processes may be connected at any given time.</p>
<p>You can have multiple buses on a single system and D-Bus already introduces two, <em>system bus</em> and <em>session bus</em>. System bus is meant for system notifications and messages (e.g. when hardware was hooked up or similar) and session bus is used locally, by desktop environment session and communication between related applications and services.</p>
<h3><a class="anchor" id="dbusservice"></a>
Services</h3>
<p>When application is going receive some messages, it must obtain a <em>service name</em>. Service name is a kind of readable address on which clients connects (much the same as concept of IP addresses and hostnames). During message exchange, daemon will use this name to send messages.</p>
<p>Service names are very similar to hostnames, e.g. here is already provided name by D-Bus library: </p>
<pre>
 org.freedesktop.DBus
</pre><p>Listener can request service name to be assigned to the only one listener so when another listener is try to acquire it, library will signal it and this application can decide what to do next. This is useful for cases when only one running application is allowed, like daemons. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classedelib_1_1EdbusConnection.html#aa42a49b80a3e0bddc537023a5f5468e4">edelib::EdbusConnection::request_name()</a></dd></dl>
<h3><a class="anchor" id="dbusobject"></a>
Objects and object paths</h3>
<p>D-Bus introduces objects, to add a kind of object-oriented approach.</p>
<p>Every bus have at least one object, representing bus itself. When application is communicating with the listener, application sends messages to one of the objects (or in D-Bus terms: <em>calls a method</em>), where listener can reply (in D-Bus parlance: <em> where object replies</em>).</p>
<p>Listener can create multiple objects.</p>
<p>Object paths are much like filesystem paths, e.g.: </p>
<pre>
 /root/some/path
</pre><p>Convention is to use service name as base for object path. For example, for <em>org.equinoxproject.Test</em>, object path could be: </p>
<pre>
 /org/equinoxproject/Test
</pre><p>Object paths must start with slash and must not ends with it. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classedelib_1_1EdbusObjectPath.html" title="Represents D-Bus object path.">edelib::EdbusObjectPath</a></dd></dl>
<h3><a class="anchor" id="dbusinterface"></a>
Interfaces</h3>
<p>D-Bus interfaces can be seen as the set of declarations and are very similar to Java interfaces. They are useful for the cases when listener wants to implement two methods with the same name, but different behavior. D-Bus will not allow such cases except methods are put in different interfaces.</p>
<p><a class="el" href="classedelib_1_1EdbusConnection.html" title="D-Bus connection and data sender.">edelib::EdbusConnection</a> and <a class="el" href="classedelib_1_1EdbusMessage.html" title="Data transporter for D-Bus.">edelib::EdbusMessage</a> provides details with the samples. </p>
</div></div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Tue Jun 5 2012 17:49:02 for edelib by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>