⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.83
Server IP:
157.245.101.34
Server:
Linux skvinfotech-website 5.4.0-131-generic #147-Ubuntu SMP Fri Oct 14 17:07:22 UTC 2022 x86_64
Server Software:
Apache/2.4.41 (Ubuntu)
PHP Version:
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
doc
/
libglib2.0-doc
/
gio
/
View File Name :
ch35.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Migrating to GDBus: GIO Reference Manual</title> <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="index.html" title="GIO Reference Manual"> <link rel="up" href="migrating.html" title="Part III. Migrating to GIO"> <link rel="prev" href="ch34s07.html" title="Data conversion"> <link rel="next" href="ch35s02.html" title="API comparison"> <meta name="generator" content="GTK-Doc V1.32 (XML mode)"> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle"> <td width="100%" align="left" class="shortcuts"></td> <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> <td><a accesskey="u" href="migrating.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> <td><a accesskey="p" href="ch34s07.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> <td><a accesskey="n" href="ch35s02.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> </tr></table> <div class="chapter"> <div class="titlepage"><div><div><h2 class="title"> <a name="id-1.5.5"></a>Migrating to GDBus</h2></div></div></div> <div class="toc"><dl class="toc"> <dt><span class="section"><a href="ch35.html#id-1.5.5.2">Conceptual differences</a></span></dt> <dt><span class="section"><a href="ch35s02.html">API comparison</a></span></dt> <dt><span class="section"><a href="ch35s03.html">Owning bus names</a></span></dt> <dt><span class="section"><a href="ch35s04.html">Creating proxies for well-known names</a></span></dt> <dt><span class="section"><a href="ch35s05.html">Generating code and docs</a></span></dt> <dd><dl> <dt><span class="section"><a href="ch35s05.html#gdbus-example-gdbus-codegen">Using gdbus-codegen</a></span></dt> <dt> <span class="refentrytitle"><a href="gdbus-org.gtk.GDBus.Example.ObjectManager.Animal.html">org.gtk.GDBus.Example.ObjectManager.Animal</a></span><span class="refpurpose"> — Example docs generated by gdbus-codegen</span> </dt> <dt> <span class="refentrytitle"><a href="gdbus-org.gtk.GDBus.Example.ObjectManager.Cat.html">org.gtk.GDBus.Example.ObjectManager.Cat</a></span><span class="refpurpose"> — More example docs generated by gdbus-codegen</span> </dt> <dt> <span class="refentrytitle"><a href="ExampleAnimal.html">ExampleAnimal</a></span><span class="refpurpose"> — Generated C code for the org.gtk.GDBus.Example.ObjectManager.Animal D-Bus interface</span> </dt> <dt> <span class="refentrytitle"><a href="ExampleCat.html">ExampleCat</a></span><span class="refpurpose"> — Generated C code for the org.gtk.GDBus.Example.ObjectManager.Cat D-Bus interface</span> </dt> <dt> <span class="refentrytitle"><a href="ExampleObject.html">ExampleObject</a></span><span class="refpurpose"> — Specialized GDBusObject types</span> </dt> <dt> <span class="refentrytitle"><a href="ExampleObjectManagerClient.html">ExampleObjectManagerClient</a></span><span class="refpurpose"> — Generated GDBusObjectManagerClient type</span> </dt> </dl></dd> </dl></div> <div class="section"> <div class="titlepage"><div><div><h2 class="title" style="clear: both"> <a name="id-1.5.5.2"></a>Conceptual differences</h2></div></div></div> <p> The central concepts of D-Bus are modelled in a very similar way in dbus-glib and GDBus. Both have objects representing connections, proxies and method invocations. But there are some important differences: </p> <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"><p> dbus-glib uses the <a class="ulink" href="http://www.freedesktop.org/wiki/Software/dbus#ReferenceImplementation.28dbus-daemonandlibdbus.29" target="_top">libdbus reference implementation</a>, GDBus doesn't. Instead, it relies on GIO streams as transport layer, and has its own implementation for the D-Bus connection setup and authentication. Apart from using streams as transport, avoiding libdbus also lets GDBus avoid some thorny multithreading issues. </p></li> <li class="listitem"><p> dbus-glib uses the GObject type system for method arguments and return values, including a homegrown container specialization mechanism. GDBus relies on the <span class="type">GVariant</span> type system which is explicitly designed to match D-Bus types. </p></li> <li class="listitem"><p> dbus-glib models only D-Bus interfaces and does not provide any types for objects. GDBus models both D-Bus interfaces (via the <a class="link" href="GDBusInterface.html" title="GDBusInterface"><span class="type">GDBusInterface</span></a>, <a class="link" href="GDBusProxy.html" title="GDBusProxy"><span class="type">GDBusProxy</span></a> and <a class="link" href="GDBusInterfaceSkeleton.html" title="GDBusInterfaceSkeleton"><span class="type">GDBusInterfaceSkeleton</span></a> types) and objects (via the <a class="link" href="GDBusObject.html" title="GDBusObject"><span class="type">GDBusObject</span></a>, <a class="link" href="GDBusObjectSkeleton.html" title="GDBusObjectSkeleton"><span class="type">GDBusObjectSkeleton</span></a> and <a class="link" href="GDBusObjectProxy.html" title="GDBusObjectProxy"><span class="type">GDBusObjectProxy</span></a> types). </p></li> <li class="listitem"><p> GDBus includes native support for the <a class="ulink" href="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties" target="_top">org.freedesktop.DBus.Properties</a> (via the <a class="link" href="GDBusProxy.html" title="GDBusProxy"><span class="type">GDBusProxy</span></a> type) and <a class="ulink" href="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager" target="_top">org.freedesktop.DBus.ObjectManager</a> D-Bus interfaces, dbus-glib doesn't. </p></li> <li class="listitem"><p> The typical way to export an object in dbus-glib involves generating glue code from XML introspection data using <span class="command"><strong>dbus-binding-tool</strong></span>. GDBus provides a similar tool called <span class="command"><strong>gdbus-codegen</strong></span> that can also generate Docbook D-Bus interface documentation. </p></li> <li class="listitem"><p> dbus-glib doesn't provide any convenience API for owning and watching bus names, GDBus provides the <a class="link" href="gio-Owning-Bus-Names.html#g-bus-own-name" title="g_bus_own_name ()"><code class="function">g_bus_own_name()</code></a> and <a class="link" href="gio-Watching-Bus-Names.html#g-bus-watch-name" title="g_bus_watch_name ()"><code class="function">g_bus_watch_name()</code></a> family of convenience functions. </p></li> <li class="listitem"><p> GDBus provides API to parse, generate and work with <a class="link" href="gio-D-Bus-Introspection-Data.html" title="D-Bus Introspection Data">Introspection XML</a>, dbus-glib doesn't. </p></li> <li class="listitem"><p> GTestDBus provides API to create isolated unit tests GDBus Test Scaffolding. </p></li> </ul></div> <p> </p> </div> </div> <div class="footer"> <hr>Generated by GTK-Doc V1.32</div> </body> </html>