⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.10
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 :
~
/
proc
/
self
/
root
/
usr
/
share
/
gtk-doc
/
html
/
gio
/
View File Name :
GDBusConnection.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>GDBusConnection: 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="gdbus-lowlevel.html" title="Low-level D-Bus Support"> <link rel="prev" href="GDBusMessage.html" title="GDBusMessage"> <link rel="next" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"> <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"> <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> <a href="#GDBusConnection.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> <a href="#GDBusConnection.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_interfaces"> <span class="dim">|</span> <a href="#GDBusConnection.implemented-interfaces" class="shortcut">Implemented Interfaces</a></span><span id="nav_properties"> <span class="dim">|</span> <a href="#GDBusConnection.properties" class="shortcut">Properties</a></span><span id="nav_signals"> <span class="dim">|</span> <a href="#GDBusConnection.signals" class="shortcut">Signals</a></span> </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="gdbus-lowlevel.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> <td><a accesskey="p" href="GDBusMessage.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> <td><a accesskey="n" href="GDBusMethodInvocation.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> </tr></table> <div class="refentry"> <a name="GDBusConnection"></a><div class="titlepage"></div> <div class="refnamediv"><table width="100%"><tr> <td valign="top"> <h2><span class="refentrytitle"><a name="GDBusConnection.top_of_page"></a>GDBusConnection</span></h2> <p>GDBusConnection — D-Bus Connections</p> </td> <td class="gallery_image" valign="top" align="right"></td> </tr></table></div> <div class="refsect1"> <a name="GDBusConnection.functions"></a><h2>Functions</h2> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="functions_proto_type"> <col class="functions_proto_name"> </colgroup> <tbody> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-bus-get" title="g_bus_get ()">g_bus_get</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="returnvalue">GDBusConnection</span></a> * </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-bus-get-finish" title="g_bus_get_finish ()">g_bus_get_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="returnvalue">GDBusConnection</span></a> * </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-bus-get-sync" title="g_bus_get_sync ()">g_bus_get_sync</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-new" title="g_dbus_connection_new ()">g_dbus_connection_new</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="returnvalue">GDBusConnection</span></a> * </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-new-finish" title="g_dbus_connection_new_finish ()">g_dbus_connection_new_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="returnvalue">GDBusConnection</span></a> * </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-new-sync" title="g_dbus_connection_new_sync ()">g_dbus_connection_new_sync</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-new-for-address" title="g_dbus_connection_new_for_address ()">g_dbus_connection_new_for_address</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="returnvalue">GDBusConnection</span></a> * </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-new-for-address-finish" title="g_dbus_connection_new_for_address_finish ()">g_dbus_connection_new_for_address_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="returnvalue">GDBusConnection</span></a> * </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-new-for-address-sync" title="g_dbus_connection_new_for_address_sync ()">g_dbus_connection_new_for_address_sync</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-start-message-processing" title="g_dbus_connection_start_message_processing ()">g_dbus_connection_start_message_processing</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-close" title="g_dbus_connection_close ()">g_dbus_connection_close</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-close-finish" title="g_dbus_connection_close_finish ()">g_dbus_connection_close_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-close-sync" title="g_dbus_connection_close_sync ()">g_dbus_connection_close_sync</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-is-closed" title="g_dbus_connection_is_closed ()">g_dbus_connection_is_closed</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-flush" title="g_dbus_connection_flush ()">g_dbus_connection_flush</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-flush-finish" title="g_dbus_connection_flush_finish ()">g_dbus_connection_flush_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-flush-sync" title="g_dbus_connection_flush_sync ()">g_dbus_connection_flush_sync</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-get-exit-on-close" title="g_dbus_connection_get_exit_on_close ()">g_dbus_connection_get_exit_on_close</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-set-exit-on-close" title="g_dbus_connection_set_exit_on_close ()">g_dbus_connection_set_exit_on_close</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> * </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-get-stream" title="g_dbus_connection_get_stream ()">g_dbus_connection_get_stream</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GDBusConnection.html#GDBusConnectionFlags" title="enum GDBusConnectionFlags"><span class="returnvalue">GDBusConnectionFlags</span></a> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-get-flags" title="g_dbus_connection_get_flags ()">g_dbus_connection_get_flags</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type">const <span class="returnvalue">gchar</span> * </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-get-guid" title="g_dbus_connection_get_guid ()">g_dbus_connection_get_guid</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type">const <span class="returnvalue">gchar</span> * </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-get-unique-name" title="g_dbus_connection_get_unique_name ()">g_dbus_connection_get_unique_name</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GDBusConnection.html#GDBusCapabilityFlags" title="enum GDBusCapabilityFlags"><span class="returnvalue">GDBusCapabilityFlags</span></a> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-get-capabilities" title="g_dbus_connection_get_capabilities ()">g_dbus_connection_get_capabilities</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GCredentials.html" title="GCredentials"><span class="returnvalue">GCredentials</span></a> * </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-get-peer-credentials" title="g_dbus_connection_get_peer_credentials ()">g_dbus_connection_get_peer_credentials</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">guint32</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-get-last-serial" title="g_dbus_connection_get_last_serial ()">g_dbus_connection_get_last_serial</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-call" title="g_dbus_connection_call ()">g_dbus_connection_call</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">GVariant</span> * </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-call-finish" title="g_dbus_connection_call_finish ()">g_dbus_connection_call_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">GVariant</span> * </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-call-sync" title="g_dbus_connection_call_sync ()">g_dbus_connection_call_sync</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-call-with-unix-fd-list" title="g_dbus_connection_call_with_unix_fd_list ()">g_dbus_connection_call_with_unix_fd_list</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">GVariant</span> * </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-call-with-unix-fd-list-finish" title="g_dbus_connection_call_with_unix_fd_list_finish ()">g_dbus_connection_call_with_unix_fd_list_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">GVariant</span> * </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-call-with-unix-fd-list-sync" title="g_dbus_connection_call_with_unix_fd_list_sync ()">g_dbus_connection_call_with_unix_fd_list_sync</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-emit-signal" title="g_dbus_connection_emit_signal ()">g_dbus_connection_emit_signal</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <span class="c_punctuation">(</span><a class="link" href="GDBusConnection.html#GDBusSignalCallback" title="GDBusSignalCallback ()">*GDBusSignalCallback</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">guint</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-signal-subscribe" title="g_dbus_connection_signal_subscribe ()">g_dbus_connection_signal_subscribe</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-signal-unsubscribe" title="g_dbus_connection_signal_unsubscribe ()">g_dbus_connection_signal_unsubscribe</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-send-message" title="g_dbus_connection_send_message ()">g_dbus_connection_send_message</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-send-message-with-reply" title="g_dbus_connection_send_message_with_reply ()">g_dbus_connection_send_message_with_reply</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="returnvalue">GDBusMessage</span></a> * </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-send-message-with-reply-finish" title="g_dbus_connection_send_message_with_reply_finish ()">g_dbus_connection_send_message_with_reply_finish</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="returnvalue">GDBusMessage</span></a> * </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-send-message-with-reply-sync" title="g_dbus_connection_send_message_with_reply_sync ()">g_dbus_connection_send_message_with_reply_sync</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="returnvalue">GDBusMessage</span></a> * </td> <td class="function_name"> <span class="c_punctuation">(</span><a class="link" href="GDBusConnection.html#GDBusMessageFilterFunction" title="GDBusMessageFilterFunction ()">*GDBusMessageFilterFunction</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">guint</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-add-filter" title="g_dbus_connection_add_filter ()">g_dbus_connection_add_filter</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-remove-filter" title="g_dbus_connection_remove_filter ()">g_dbus_connection_remove_filter</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">void</span> </td> <td class="function_name"> <span class="c_punctuation">(</span><a class="link" href="GDBusConnection.html#GDBusInterfaceMethodCallFunc" title="GDBusInterfaceMethodCallFunc ()">*GDBusInterfaceMethodCallFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">GVariant</span> * </td> <td class="function_name"> <span class="c_punctuation">(</span><a class="link" href="GDBusConnection.html#GDBusInterfaceGetPropertyFunc" title="GDBusInterfaceGetPropertyFunc ()">*GDBusInterfaceGetPropertyFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <span class="c_punctuation">(</span><a class="link" href="GDBusConnection.html#GDBusInterfaceSetPropertyFunc" title="GDBusInterfaceSetPropertyFunc ()">*GDBusInterfaceSetPropertyFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">guint</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-register-object" title="g_dbus_connection_register_object ()">g_dbus_connection_register_object</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-unregister-object" title="g_dbus_connection_unregister_object ()">g_dbus_connection_unregister_object</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">guint</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-register-object-with-closures" title="g_dbus_connection_register_object_with_closures ()">g_dbus_connection_register_object_with_closures</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gchar</span> ** </td> <td class="function_name"> <span class="c_punctuation">(</span><a class="link" href="GDBusConnection.html#GDBusSubtreeEnumerateFunc" title="GDBusSubtreeEnumerateFunc ()">*GDBusSubtreeEnumerateFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <a class="link" href="gio-D-Bus-Introspection-Data.html#GDBusInterfaceInfo"><span class="returnvalue">GDBusInterfaceInfo</span></a> ** </td> <td class="function_name"> <span class="c_punctuation">(</span><a class="link" href="GDBusConnection.html#GDBusSubtreeIntrospectFunc" title="GDBusSubtreeIntrospectFunc ()">*GDBusSubtreeIntrospectFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type">const <a class="link" href="GDBusConnection.html#GDBusInterfaceVTable" title="GDBusInterfaceVTable"><span class="returnvalue">GDBusInterfaceVTable</span></a> * </td> <td class="function_name"> <span class="c_punctuation">(</span><a class="link" href="GDBusConnection.html#GDBusSubtreeDispatchFunc" title="GDBusSubtreeDispatchFunc ()">*GDBusSubtreeDispatchFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">guint</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-register-subtree" title="g_dbus_connection_register_subtree ()">g_dbus_connection_register_subtree</a> <span class="c_punctuation">()</span> </td> </tr> <tr> <td class="function_type"> <span class="returnvalue">gboolean</span> </td> <td class="function_name"> <a class="link" href="GDBusConnection.html#g-dbus-connection-unregister-subtree" title="g_dbus_connection_unregister_subtree ()">g_dbus_connection_unregister_subtree</a> <span class="c_punctuation">()</span> </td> </tr> </tbody> </table></div> </div> <div class="refsect1"> <a name="GDBusConnection.properties"></a><h2>Properties</h2> <div class="informaltable"><table class="informaltable" border="0"> <colgroup> <col width="150px" class="properties_type"> <col width="300px" class="properties_name"> <col width="200px" class="properties_flags"> </colgroup> <tbody> <tr> <td class="property_type"> <span class="type">gchar</span> *</td> <td class="property_name"><a class="link" href="GDBusConnection.html#GDBusConnection--address" title="The “address” property">address</a></td> <td class="property_flags">Write / Construct Only</td> </tr> <tr> <td class="property_type"> <a class="link" href="GDBusAuthObserver.html" title="GDBusAuthObserver"><span class="type">GDBusAuthObserver</span></a> *</td> <td class="property_name"><a class="link" href="GDBusConnection.html#GDBusConnection--authentication-observer" title="The “authentication-observer” property">authentication-observer</a></td> <td class="property_flags">Write / Construct Only</td> </tr> <tr> <td class="property_type"><a class="link" href="GDBusConnection.html#GDBusCapabilityFlags" title="enum GDBusCapabilityFlags"><span class="type">GDBusCapabilityFlags</span></a></td> <td class="property_name"><a class="link" href="GDBusConnection.html#GDBusConnection--capabilities" title="The “capabilities” property">capabilities</a></td> <td class="property_flags">Read</td> </tr> <tr> <td class="property_type"><span class="type">gboolean</span></td> <td class="property_name"><a class="link" href="GDBusConnection.html#GDBusConnection--closed" title="The “closed” property">closed</a></td> <td class="property_flags">Read</td> </tr> <tr> <td class="property_type"><span class="type">gboolean</span></td> <td class="property_name"><a class="link" href="GDBusConnection.html#GDBusConnection--exit-on-close" title="The “exit-on-close” property">exit-on-close</a></td> <td class="property_flags">Read / Write</td> </tr> <tr> <td class="property_type"><a class="link" href="GDBusConnection.html#GDBusConnectionFlags" title="enum GDBusConnectionFlags"><span class="type">GDBusConnectionFlags</span></a></td> <td class="property_name"><a class="link" href="GDBusConnection.html#GDBusConnection--flags" title="The “flags” property">flags</a></td> <td class="property_flags">Read / Write / Construct Only</td> </tr> <tr> <td class="property_type"> <span class="type">gchar</span> *</td> <td class="property_name"><a class="link" href="GDBusConnection.html#GDBusConnection--guid" title="The “guid” property">guid</a></td> <td class="property_flags">Read / Write / Construct Only</td> </tr> <tr> <td class="property_type"> <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a> *</td> <td class="property_name"><a class="link" href="GDBusConnection.html#GDBusConnection--stream" title="The “stream” property">stream</a></td> <td class="property_flags">Read / Write / Construct Only</td> </tr> <tr> <td class="property_type"> <span class="type">gchar</span> *</td> <td class="property_name"><a class="link" href="GDBusConnection.html#GDBusConnection--unique-name" title="The “unique-name” property">unique-name</a></td> <td class="property_flags">Read</td> </tr> </tbody> </table></div> </div> <div class="refsect1"> <a name="GDBusConnection.signals"></a><h2>Signals</h2> <div class="informaltable"><table class="informaltable" border="0"> <colgroup> <col width="150px" class="signal_proto_type"> <col width="300px" class="signal_proto_name"> <col width="200px" class="signal_proto_flags"> </colgroup> <tbody><tr> <td class="signal_type"><span class="returnvalue">void</span></td> <td class="signal_name"><a class="link" href="GDBusConnection.html#GDBusConnection-closed" title="The “closed” signal">closed</a></td> <td class="signal_flags">Run Last</td> </tr></tbody> </table></div> </div> <div class="refsect1"> <a name="GDBusConnection.other"></a><h2>Types and Values</h2> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="other_proto_type"> <col class="other_proto_name"> </colgroup> <tbody> <tr> <td class="datatype_keyword">enum</td> <td class="function_name"><a class="link" href="GDBusConnection.html#GBusType" title="enum GBusType">GBusType</a></td> </tr> <tr> <td class="datatype_keyword"> </td> <td class="function_name"><a class="link" href="GDBusConnection.html#GDBusConnection-struct" title="GDBusConnection">GDBusConnection</a></td> </tr> <tr> <td class="datatype_keyword">enum</td> <td class="function_name"><a class="link" href="GDBusConnection.html#GDBusConnectionFlags" title="enum GDBusConnectionFlags">GDBusConnectionFlags</a></td> </tr> <tr> <td class="datatype_keyword">enum</td> <td class="function_name"><a class="link" href="GDBusConnection.html#GDBusCapabilityFlags" title="enum GDBusCapabilityFlags">GDBusCapabilityFlags</a></td> </tr> <tr> <td class="datatype_keyword">enum</td> <td class="function_name"><a class="link" href="GDBusConnection.html#GDBusCallFlags" title="enum GDBusCallFlags">GDBusCallFlags</a></td> </tr> <tr> <td class="datatype_keyword">enum</td> <td class="function_name"><a class="link" href="GDBusConnection.html#GDBusSignalFlags" title="enum GDBusSignalFlags">GDBusSignalFlags</a></td> </tr> <tr> <td class="datatype_keyword">enum</td> <td class="function_name"><a class="link" href="GDBusConnection.html#GDBusSendMessageFlags" title="enum GDBusSendMessageFlags">GDBusSendMessageFlags</a></td> </tr> <tr> <td class="datatype_keyword"> </td> <td class="function_name"><a class="link" href="GDBusConnection.html#GDBusInterfaceVTable" title="GDBusInterfaceVTable">GDBusInterfaceVTable</a></td> </tr> <tr> <td class="datatype_keyword"> </td> <td class="function_name"><a class="link" href="GDBusConnection.html#GDBusSubtreeVTable" title="GDBusSubtreeVTable">GDBusSubtreeVTable</a></td> </tr> <tr> <td class="datatype_keyword">enum</td> <td class="function_name"><a class="link" href="GDBusConnection.html#GDBusSubtreeFlags" title="enum GDBusSubtreeFlags">GDBusSubtreeFlags</a></td> </tr> </tbody> </table></div> </div> <div class="refsect1"> <a name="GDBusConnection.object-hierarchy"></a><h2>Object Hierarchy</h2> <pre class="screen"> GEnum <span class="lineart">╰──</span> GBusType GFlags <span class="lineart">├──</span> GDBusCallFlags <span class="lineart">├──</span> GDBusCapabilityFlags <span class="lineart">├──</span> GDBusConnectionFlags <span class="lineart">├──</span> GDBusSendMessageFlags <span class="lineart">├──</span> GDBusSignalFlags <span class="lineart">╰──</span> GDBusSubtreeFlags GObject <span class="lineart">╰──</span> GDBusConnection </pre> </div> <div class="refsect1"> <a name="GDBusConnection.implemented-interfaces"></a><h2>Implemented Interfaces</h2> <p> GDBusConnection implements <a class="link" href="GInitable.html" title="GInitable">GInitable</a> and <a class="link" href="GAsyncInitable.html" title="GAsyncInitable">GAsyncInitable</a>.</p> </div> <div class="refsect1"> <a name="GDBusConnection.includes"></a><h2>Includes</h2> <pre class="synopsis">#include <gio/gio.h> </pre> </div> <div class="refsect1"> <a name="GDBusConnection.description"></a><h2>Description</h2> <p>The <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> type is used for D-Bus connections to remote peers such as a message buses. It is a low-level API that offers a lot of flexibility. For instance, it lets you establish a connection over any transport that can by represented as a <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a>.</p> <p>This class is rarely used directly in D-Bus clients. If you are writing a D-Bus client, it is often easier to use 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>, <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> or <a class="link" href="GDBusProxy.html#g-dbus-proxy-new-for-bus" title="g_dbus_proxy_new_for_bus ()"><code class="function">g_dbus_proxy_new_for_bus()</code></a> APIs.</p> <p>As an exception to the usual GLib rule that a particular object must not be used by two threads at the same time, <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a>'s methods may be called from any thread. This is so that <a class="link" href="GDBusConnection.html#g-bus-get" title="g_bus_get ()"><code class="function">g_bus_get()</code></a> and <a class="link" href="GDBusConnection.html#g-bus-get-sync" title="g_bus_get_sync ()"><code class="function">g_bus_get_sync()</code></a> can safely return the same <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> when called from any thread.</p> <p>Most of the ways to obtain a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> automatically initialize it (i.e. connect to D-Bus): for instance, <a class="link" href="GDBusConnection.html#g-dbus-connection-new" title="g_dbus_connection_new ()"><code class="function">g_dbus_connection_new()</code></a> and <a class="link" href="GDBusConnection.html#g-bus-get" title="g_bus_get ()"><code class="function">g_bus_get()</code></a>, and the synchronous versions of those methods, give you an initialized connection. Language bindings for GIO should use <a class="link" href="GInitable.html#g-initable-new" title="g_initable_new ()"><code class="function">g_initable_new()</code></a> or <a class="link" href="GAsyncInitable.html#g-async-initable-new-async" title="g_async_initable_new_async ()"><code class="function">g_async_initable_new_async()</code></a>, which also initialize the connection.</p> <p>If you construct an uninitialized <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a>, such as via <code class="function">g_object_new()</code>, you must initialize it via <a class="link" href="GInitable.html#g-initable-init" title="g_initable_init ()"><code class="function">g_initable_init()</code></a> or <a class="link" href="GAsyncInitable.html#g-async-initable-init-async" title="g_async_initable_init_async ()"><code class="function">g_async_initable_init_async()</code></a> before using its methods or properties. Calling methods or accessing properties on a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> that has not completed initialization successfully is considered to be invalid, and leads to undefined behaviour. In particular, if initialization fails with a <span class="type">GError</span>, the only valid thing you can do with that <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> is to free it with <code class="function">g_object_unref()</code>.</p> <div class="refsect3"> <a name="gdbus-server"></a><h4>An example D-Bus server</h4> <p>Here is an example for a D-Bus server: <a class="ulink" href="https://git.gnome.org/browse/glib/tree/gio/tests/gdbus-example-server.c" target="_top">gdbus-example-server.c</a></p> </div> <div class="refsect3"> <a name="gdbus-subtree-server"></a><h4>An example for exporting a subtree</h4> <p>Here is an example for exporting a subtree: <a class="ulink" href="https://git.gnome.org/browse/glib/tree/gio/tests/gdbus-example-subtree.c" target="_top">gdbus-example-subtree.c</a></p> </div> <div class="refsect3"> <a name="gdbus-unix-fd-client"></a><h4>An example for file descriptor passing</h4> <p>Here is an example for passing UNIX file descriptors: <a class="ulink" href="https://git.gnome.org/browse/glib/tree/gio/tests/gdbus-example-unix-fd-client.c" target="_top">gdbus-unix-fd-client.c</a></p> </div> <div class="refsect3"> <a name="gdbus-export"></a><h4>An example for exporting a GObject</h4> <p>Here is an example for exporting a <span class="type">GObject</span>: <a class="ulink" href="https://git.gnome.org/browse/glib/tree/gio/tests/gdbus-example-export.c" target="_top">gdbus-example-export.c</a></p> </div> </div> <div class="refsect1"> <a name="GDBusConnection.functions_details"></a><h2>Functions</h2> <div class="refsect2"> <a name="g-bus-get"></a><h3>g_bus_get ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_bus_get (<em class="parameter"><code><a class="link" href="GDBusConnection.html#GBusType" title="enum GBusType"><span class="type">GBusType</span></a> bus_type</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously connects to the message bus specified by <em class="parameter"><code>bus_type</code></em> .</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be invoked. You can then call <a class="link" href="GDBusConnection.html#g-bus-get-finish" title="g_bus_get_finish ()"><code class="function">g_bus_get_finish()</code></a> to get the result of the operation.</p> <p>This is an asynchronous failable function. See <a class="link" href="GDBusConnection.html#g-bus-get-sync" title="g_bus_get_sync ()"><code class="function">g_bus_get_sync()</code></a> for the synchronous version.</p> <div class="refsect3"> <a name="g-bus-get.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>bus_type</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html#GBusType" title="enum GBusType"><span class="type">GBusType</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to <em class="parameter"><code>callback</code></em> </p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-bus-get-finish"></a><h3>g_bus_get_finish ()</h3> <pre class="programlisting"><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="returnvalue">GDBusConnection</span></a> * g_bus_get_finish (<em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an operation started with <a class="link" href="GDBusConnection.html#g-bus-get" title="g_bus_get ()"><code class="function">g_bus_get()</code></a>.</p> <p>The returned object is a singleton, that is, shared with other callers of <a class="link" href="GDBusConnection.html#g-bus-get" title="g_bus_get ()"><code class="function">g_bus_get()</code></a> and <a class="link" href="GDBusConnection.html#g-bus-get-sync" title="g_bus_get_sync ()"><code class="function">g_bus_get_sync()</code></a> for <em class="parameter"><code>bus_type</code></em> . In the event that you need a private message bus connection, use <a class="link" href="gio-D-Bus-Addresses.html#g-dbus-address-get-for-bus-sync" title="g_dbus_address_get_for_bus_sync ()"><code class="function">g_dbus_address_get_for_bus_sync()</code></a> and <a class="link" href="GDBusConnection.html#g-dbus-connection-new-for-address" title="g_dbus_connection_new_for_address ()"><code class="function">g_dbus_connection_new_for_address()</code></a>.</p> <p>Note that the returned <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> object will (usually) have the <a class="link" href="GDBusConnection.html#GDBusConnection--exit-on-close" title="The “exit-on-close” property"><span class="type">“exit-on-close”</span></a> property set to <code class="literal">TRUE</code>.</p> <div class="refsect3"> <a name="g-bus-get-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> obtained from the <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> passed to <a class="link" href="GDBusConnection.html#g-bus-get" title="g_bus_get ()"><code class="function">g_bus_get()</code></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-bus-get-finish.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> or <code class="literal">NULL</code> if <em class="parameter"><code>error</code></em> is set. Free with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-bus-get-sync"></a><h3>g_bus_get_sync ()</h3> <pre class="programlisting"><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="returnvalue">GDBusConnection</span></a> * g_bus_get_sync (<em class="parameter"><code><a class="link" href="GDBusConnection.html#GBusType" title="enum GBusType"><span class="type">GBusType</span></a> bus_type</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Synchronously connects to the message bus specified by <em class="parameter"><code>bus_type</code></em> . Note that the returned object may shared with other callers, e.g. if two separate parts of a process calls this function with the same <em class="parameter"><code>bus_type</code></em> , they will share the same object.</p> <p>This is a synchronous failable function. See <a class="link" href="GDBusConnection.html#g-bus-get" title="g_bus_get ()"><code class="function">g_bus_get()</code></a> and <a class="link" href="GDBusConnection.html#g-bus-get-finish" title="g_bus_get_finish ()"><code class="function">g_bus_get_finish()</code></a> for the asynchronous version.</p> <p>The returned object is a singleton, that is, shared with other callers of <a class="link" href="GDBusConnection.html#g-bus-get" title="g_bus_get ()"><code class="function">g_bus_get()</code></a> and <a class="link" href="GDBusConnection.html#g-bus-get-sync" title="g_bus_get_sync ()"><code class="function">g_bus_get_sync()</code></a> for <em class="parameter"><code>bus_type</code></em> . In the event that you need a private message bus connection, use <a class="link" href="gio-D-Bus-Addresses.html#g-dbus-address-get-for-bus-sync" title="g_dbus_address_get_for_bus_sync ()"><code class="function">g_dbus_address_get_for_bus_sync()</code></a> and <a class="link" href="GDBusConnection.html#g-dbus-connection-new-for-address" title="g_dbus_connection_new_for_address ()"><code class="function">g_dbus_connection_new_for_address()</code></a>.</p> <p>Note that the returned <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> object will (usually) have the <a class="link" href="GDBusConnection.html#GDBusConnection--exit-on-close" title="The “exit-on-close” property"><span class="type">“exit-on-close”</span></a> property set to <code class="literal">TRUE</code>.</p> <div class="refsect3"> <a name="g-bus-get-sync.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>bus_type</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html#GBusType" title="enum GBusType"><span class="type">GBusType</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-bus-get-sync.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> or <code class="literal">NULL</code> if <em class="parameter"><code>error</code></em> is set. Free with <code class="function">g_object_unref()</code>. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-new"></a><h3>g_dbus_connection_new ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_dbus_connection_new (<em class="parameter"><code><a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a> *stream</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *guid</code></em>, <em class="parameter"><code><a class="link" href="GDBusConnection.html#GDBusConnectionFlags" title="enum GDBusConnectionFlags"><span class="type">GDBusConnectionFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GDBusAuthObserver.html" title="GDBusAuthObserver"><span class="type">GDBusAuthObserver</span></a> *observer</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously sets up a D-Bus connection for exchanging D-Bus messages with the end represented by <em class="parameter"><code>stream</code></em> .</p> <p>If <em class="parameter"><code>stream</code></em> is a <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a>, then the corresponding <a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> will be put into non-blocking mode.</p> <p>The D-Bus connection will interact with <em class="parameter"><code>stream</code></em> from a worker thread. As a result, the caller should not interact with <em class="parameter"><code>stream</code></em> after this method has been called, except by calling <code class="function">g_object_unref()</code> on it.</p> <p>If <em class="parameter"><code>observer</code></em> is not <code class="literal">NULL</code> it may be used to control the authentication process.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be invoked. You can then call <a class="link" href="GDBusConnection.html#g-dbus-connection-new-finish" title="g_dbus_connection_new_finish ()"><code class="function">g_dbus_connection_new_finish()</code></a> to get the result of the operation.</p> <p>This is an asynchronous failable constructor. See <a class="link" href="GDBusConnection.html#g-dbus-connection-new-sync" title="g_dbus_connection_new_sync ()"><code class="function">g_dbus_connection_new_sync()</code></a> for the synchronous version.</p> <div class="refsect3"> <a name="g-dbus-connection-new.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>stream</p></td> <td class="parameter_description"><p>a <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>guid</p></td> <td class="parameter_description"><p>the GUID to use if authenticating as a server or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags describing how to make the connection</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>observer</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusAuthObserver.html" title="GDBusAuthObserver"><span class="type">GDBusAuthObserver</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to <em class="parameter"><code>callback</code></em> </p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-new-finish"></a><h3>g_dbus_connection_new_finish ()</h3> <pre class="programlisting"><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="returnvalue">GDBusConnection</span></a> * g_dbus_connection_new_finish (<em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an operation started with <a class="link" href="GDBusConnection.html#g-dbus-connection-new" title="g_dbus_connection_new ()"><code class="function">g_dbus_connection_new()</code></a>.</p> <div class="refsect3"> <a name="g-dbus-connection-new-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> obtained from the <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> passed to <a class="link" href="GDBusConnection.html#g-dbus-connection-new" title="g_dbus_connection_new ()"><code class="function">g_dbus_connection_new()</code></a>.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-new-finish.returns"></a><h4>Returns</h4> <p> a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> or <code class="literal">NULL</code> if <em class="parameter"><code>error</code></em> is set. Free with <code class="function">g_object_unref()</code>.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-new-sync"></a><h3>g_dbus_connection_new_sync ()</h3> <pre class="programlisting"><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="returnvalue">GDBusConnection</span></a> * g_dbus_connection_new_sync (<em class="parameter"><code><a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a> *stream</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *guid</code></em>, <em class="parameter"><code><a class="link" href="GDBusConnection.html#GDBusConnectionFlags" title="enum GDBusConnectionFlags"><span class="type">GDBusConnectionFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GDBusAuthObserver.html" title="GDBusAuthObserver"><span class="type">GDBusAuthObserver</span></a> *observer</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Synchronously sets up a D-Bus connection for exchanging D-Bus messages with the end represented by <em class="parameter"><code>stream</code></em> .</p> <p>If <em class="parameter"><code>stream</code></em> is a <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a>, then the corresponding <a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> will be put into non-blocking mode.</p> <p>The D-Bus connection will interact with <em class="parameter"><code>stream</code></em> from a worker thread. As a result, the caller should not interact with <em class="parameter"><code>stream</code></em> after this method has been called, except by calling <code class="function">g_object_unref()</code> on it.</p> <p>If <em class="parameter"><code>observer</code></em> is not <code class="literal">NULL</code> it may be used to control the authentication process.</p> <p>This is a synchronous failable constructor. See <a class="link" href="GDBusConnection.html#g-dbus-connection-new" title="g_dbus_connection_new ()"><code class="function">g_dbus_connection_new()</code></a> for the asynchronous version.</p> <div class="refsect3"> <a name="g-dbus-connection-new-sync.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>stream</p></td> <td class="parameter_description"><p>a <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>guid</p></td> <td class="parameter_description"><p>the GUID to use if authenticating as a server or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags describing how to make the connection</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>observer</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusAuthObserver.html" title="GDBusAuthObserver"><span class="type">GDBusAuthObserver</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-new-sync.returns"></a><h4>Returns</h4> <p> a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> or <code class="literal">NULL</code> if <em class="parameter"><code>error</code></em> is set. Free with <code class="function">g_object_unref()</code>.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-new-for-address"></a><h3>g_dbus_connection_new_for_address ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_dbus_connection_new_for_address (<em class="parameter"><code>const <span class="type">gchar</span> *address</code></em>, <em class="parameter"><code><a class="link" href="GDBusConnection.html#GDBusConnectionFlags" title="enum GDBusConnectionFlags"><span class="type">GDBusConnectionFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GDBusAuthObserver.html" title="GDBusAuthObserver"><span class="type">GDBusAuthObserver</span></a> *observer</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously connects and sets up a D-Bus client connection for exchanging D-Bus messages with an endpoint specified by <em class="parameter"><code>address</code></em> which must be in the <a class="ulink" href="https://dbus.freedesktop.org/doc/dbus-specification.html#addresses" target="_top">D-Bus address format</a>.</p> <p>This constructor can only be used to initiate client-side connections - use <a class="link" href="GDBusConnection.html#g-dbus-connection-new" title="g_dbus_connection_new ()"><code class="function">g_dbus_connection_new()</code></a> if you need to act as the server. In particular, <em class="parameter"><code>flags</code></em> cannot contain the <a class="link" href="GDBusConnection.html#G-DBUS-CONNECTION-FLAGS-AUTHENTICATION-SERVER:CAPS"><code class="literal">G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER</code></a> or <a class="link" href="GDBusConnection.html#G-DBUS-CONNECTION-FLAGS-AUTHENTICATION-ALLOW-ANONYMOUS:CAPS"><code class="literal">G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS</code></a> flags.</p> <p>When the operation is finished, <em class="parameter"><code>callback</code></em> will be invoked. You can then call <a class="link" href="GDBusConnection.html#g-dbus-connection-new-for-address-finish" title="g_dbus_connection_new_for_address_finish ()"><code class="function">g_dbus_connection_new_for_address_finish()</code></a> to get the result of the operation.</p> <p>If <em class="parameter"><code>observer</code></em> is not <code class="literal">NULL</code> it may be used to control the authentication process.</p> <p>This is an asynchronous failable constructor. See <a class="link" href="GDBusConnection.html#g-dbus-connection-new-for-address-sync" title="g_dbus_connection_new_for_address_sync ()"><code class="function">g_dbus_connection_new_for_address_sync()</code></a> for the synchronous version.</p> <div class="refsect3"> <a name="g-dbus-connection-new-for-address.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>address</p></td> <td class="parameter_description"><p>a D-Bus address</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags describing how to make the connection</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>observer</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusAuthObserver.html" title="GDBusAuthObserver"><span class="type">GDBusAuthObserver</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to <em class="parameter"><code>callback</code></em> </p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-new-for-address-finish"></a><h3>g_dbus_connection_new_for_address_finish ()</h3> <pre class="programlisting"><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="returnvalue">GDBusConnection</span></a> * g_dbus_connection_new_for_address_finish (<em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an operation started with <a class="link" href="GDBusConnection.html#g-dbus-connection-new-for-address" title="g_dbus_connection_new_for_address ()"><code class="function">g_dbus_connection_new_for_address()</code></a>.</p> <div class="refsect3"> <a name="g-dbus-connection-new-for-address-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> obtained from the <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> passed to <a class="link" href="GDBusConnection.html#g-dbus-connection-new" title="g_dbus_connection_new ()"><code class="function">g_dbus_connection_new()</code></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-new-for-address-finish.returns"></a><h4>Returns</h4> <p> a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> or <code class="literal">NULL</code> if <em class="parameter"><code>error</code></em> is set. Free with <code class="function">g_object_unref()</code>.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-new-for-address-sync"></a><h3>g_dbus_connection_new_for_address_sync ()</h3> <pre class="programlisting"><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="returnvalue">GDBusConnection</span></a> * g_dbus_connection_new_for_address_sync (<em class="parameter"><code>const <span class="type">gchar</span> *address</code></em>, <em class="parameter"><code><a class="link" href="GDBusConnection.html#GDBusConnectionFlags" title="enum GDBusConnectionFlags"><span class="type">GDBusConnectionFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GDBusAuthObserver.html" title="GDBusAuthObserver"><span class="type">GDBusAuthObserver</span></a> *observer</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Synchronously connects and sets up a D-Bus client connection for exchanging D-Bus messages with an endpoint specified by <em class="parameter"><code>address</code></em> which must be in the <a class="ulink" href="https://dbus.freedesktop.org/doc/dbus-specification.html#addresses" target="_top">D-Bus address format</a>.</p> <p>This constructor can only be used to initiate client-side connections - use <a class="link" href="GDBusConnection.html#g-dbus-connection-new-sync" title="g_dbus_connection_new_sync ()"><code class="function">g_dbus_connection_new_sync()</code></a> if you need to act as the server. In particular, <em class="parameter"><code>flags</code></em> cannot contain the <a class="link" href="GDBusConnection.html#G-DBUS-CONNECTION-FLAGS-AUTHENTICATION-SERVER:CAPS"><code class="literal">G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER</code></a> or <a class="link" href="GDBusConnection.html#G-DBUS-CONNECTION-FLAGS-AUTHENTICATION-ALLOW-ANONYMOUS:CAPS"><code class="literal">G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS</code></a> flags.</p> <p>This is a synchronous failable constructor. See <a class="link" href="GDBusConnection.html#g-dbus-connection-new-for-address" title="g_dbus_connection_new_for_address ()"><code class="function">g_dbus_connection_new_for_address()</code></a> for the asynchronous version.</p> <p>If <em class="parameter"><code>observer</code></em> is not <code class="literal">NULL</code> it may be used to control the authentication process.</p> <div class="refsect3"> <a name="g-dbus-connection-new-for-address-sync.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>address</p></td> <td class="parameter_description"><p>a D-Bus address</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags describing how to make the connection</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>observer</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusAuthObserver.html" title="GDBusAuthObserver"><span class="type">GDBusAuthObserver</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-new-for-address-sync.returns"></a><h4>Returns</h4> <p> a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> or <code class="literal">NULL</code> if <em class="parameter"><code>error</code></em> is set. Free with <code class="function">g_object_unref()</code>.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-start-message-processing"></a><h3>g_dbus_connection_start_message_processing ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_dbus_connection_start_message_processing (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>);</pre> <p>If <em class="parameter"><code>connection</code></em> was created with <a class="link" href="GDBusConnection.html#G-DBUS-CONNECTION-FLAGS-DELAY-MESSAGE-PROCESSING:CAPS"><code class="literal">G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING</code></a>, this method starts processing messages. Does nothing on if <em class="parameter"><code>connection</code></em> wasn't created with this flag or if the method has already been called.</p> <div class="refsect3"> <a name="g-dbus-connection-start-message-processing.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-close"></a><h3>g_dbus_connection_close ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_dbus_connection_close (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Closes <em class="parameter"><code>connection</code></em> . Note that this never causes the process to exit (this might only happen if the other end of a shared message bus connection disconnects, see <a class="link" href="GDBusConnection.html#GDBusConnection--exit-on-close" title="The “exit-on-close” property"><span class="type">“exit-on-close”</span></a>).</p> <p>Once the connection is closed, operations such as sending a message will return with the error <a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED:CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a>. Closing a connection will not automatically flush the connection so queued messages may be lost. Use <a class="link" href="GDBusConnection.html#g-dbus-connection-flush" title="g_dbus_connection_flush ()"><code class="function">g_dbus_connection_flush()</code></a> if you need such guarantees.</p> <p>If <em class="parameter"><code>connection</code></em> is already closed, this method fails with <a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED:CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a>.</p> <p>When <em class="parameter"><code>connection</code></em> has been closed, the <a class="link" href="GDBusConnection.html#GDBusConnection-closed" title="The “closed” signal"><span class="type">“closed”</span></a> signal is emitted in the thread-default main context of the thread that <em class="parameter"><code>connection</code></em> was constructed in.</p> <p>This is an asynchronous method. When the operation is finished, <em class="parameter"><code>callback</code></em> will be invoked in the thread-default main context of the thread you are calling this method from. You can then call <a class="link" href="GDBusConnection.html#g-dbus-connection-close-finish" title="g_dbus_connection_close_finish ()"><code class="function">g_dbus_connection_close_finish()</code></a> to get the result of the operation. See <a class="link" href="GDBusConnection.html#g-dbus-connection-close-sync" title="g_dbus_connection_close_sync ()"><code class="function">g_dbus_connection_close_sync()</code></a> for the synchronous version.</p> <div class="refsect3"> <a name="g-dbus-connection-close.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied or <code class="literal">NULL</code> if you don't care about the result. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>The data to pass to <em class="parameter"><code>callback</code></em> </p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-close-finish"></a><h3>g_dbus_connection_close_finish ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_dbus_connection_close_finish (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an operation started with <a class="link" href="GDBusConnection.html#g-dbus-connection-close" title="g_dbus_connection_close ()"><code class="function">g_dbus_connection_close()</code></a>.</p> <div class="refsect3"> <a name="g-dbus-connection-close-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> obtained from the <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> passed to <a class="link" href="GDBusConnection.html#g-dbus-connection-close" title="g_dbus_connection_close ()"><code class="function">g_dbus_connection_close()</code></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-close-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the operation succeeded, <code class="literal">FALSE</code> if <em class="parameter"><code>error</code></em> is set</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-close-sync"></a><h3>g_dbus_connection_close_sync ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_dbus_connection_close_sync (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Synchronously closes <em class="parameter"><code>connection</code></em> . The calling thread is blocked until this is done. See <a class="link" href="GDBusConnection.html#g-dbus-connection-close" title="g_dbus_connection_close ()"><code class="function">g_dbus_connection_close()</code></a> for the asynchronous version of this method and more details about what it does.</p> <div class="refsect3"> <a name="g-dbus-connection-close-sync.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-close-sync.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the operation succeeded, <code class="literal">FALSE</code> if <em class="parameter"><code>error</code></em> is set</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-is-closed"></a><h3>g_dbus_connection_is_closed ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_dbus_connection_is_closed (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>);</pre> <p>Gets whether <em class="parameter"><code>connection</code></em> is closed.</p> <div class="refsect3"> <a name="g-dbus-connection-is-closed.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-is-closed.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the connection is closed, <code class="literal">FALSE</code> otherwise</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-flush"></a><h3>g_dbus_connection_flush ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_dbus_connection_flush (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously flushes <em class="parameter"><code>connection</code></em> , that is, writes all queued outgoing message to the transport and then flushes the transport (using <a class="link" href="GOutputStream.html#g-output-stream-flush-async" title="g_output_stream_flush_async ()"><code class="function">g_output_stream_flush_async()</code></a>). This is useful in programs that wants to emit a D-Bus signal and then exit immediately. Without flushing the connection, there is no guaranteed that the message has been sent to the networking buffers in the OS kernel.</p> <p>This is an asynchronous method. When the operation is finished, <em class="parameter"><code>callback</code></em> will be invoked in the thread-default main context of the thread you are calling this method from. You can then call <a class="link" href="GDBusConnection.html#g-dbus-connection-flush-finish" title="g_dbus_connection_flush_finish ()"><code class="function">g_dbus_connection_flush_finish()</code></a> to get the result of the operation. See <a class="link" href="GDBusConnection.html#g-dbus-connection-flush-sync" title="g_dbus_connection_flush_sync ()"><code class="function">g_dbus_connection_flush_sync()</code></a> for the synchronous version.</p> <div class="refsect3"> <a name="g-dbus-connection-flush.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied or <code class="literal">NULL</code> if you don't care about the result. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>The data to pass to <em class="parameter"><code>callback</code></em> </p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-flush-finish"></a><h3>g_dbus_connection_flush_finish ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_dbus_connection_flush_finish (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an operation started with <a class="link" href="GDBusConnection.html#g-dbus-connection-flush" title="g_dbus_connection_flush ()"><code class="function">g_dbus_connection_flush()</code></a>.</p> <div class="refsect3"> <a name="g-dbus-connection-flush-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> obtained from the <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> passed to <a class="link" href="GDBusConnection.html#g-dbus-connection-flush" title="g_dbus_connection_flush ()"><code class="function">g_dbus_connection_flush()</code></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-flush-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the operation succeeded, <code class="literal">FALSE</code> if <em class="parameter"><code>error</code></em> is set</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-flush-sync"></a><h3>g_dbus_connection_flush_sync ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_dbus_connection_flush_sync (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Synchronously flushes <em class="parameter"><code>connection</code></em> . The calling thread is blocked until this is done. See <a class="link" href="GDBusConnection.html#g-dbus-connection-flush" title="g_dbus_connection_flush ()"><code class="function">g_dbus_connection_flush()</code></a> for the asynchronous version of this method and more details about what it does.</p> <div class="refsect3"> <a name="g-dbus-connection-flush-sync.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-flush-sync.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the operation succeeded, <code class="literal">FALSE</code> if <em class="parameter"><code>error</code></em> is set</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-get-exit-on-close"></a><h3>g_dbus_connection_get_exit_on_close ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_dbus_connection_get_exit_on_close (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>);</pre> <p>Gets whether the process is terminated when <em class="parameter"><code>connection</code></em> is closed by the remote peer. See <a class="link" href="GDBusConnection.html#GDBusConnection--exit-on-close" title="The “exit-on-close” property"><span class="type">“exit-on-close”</span></a> for more details.</p> <div class="refsect3"> <a name="g-dbus-connection-get-exit-on-close.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-get-exit-on-close.returns"></a><h4>Returns</h4> <p> whether the process is terminated when <em class="parameter"><code>connection</code></em> is closed by the remote peer</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-set-exit-on-close"></a><h3>g_dbus_connection_set_exit_on_close ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_dbus_connection_set_exit_on_close (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code><span class="type">gboolean</span> exit_on_close</code></em>);</pre> <p>Sets whether the process should be terminated when <em class="parameter"><code>connection</code></em> is closed by the remote peer. See <a class="link" href="GDBusConnection.html#GDBusConnection--exit-on-close" title="The “exit-on-close” property"><span class="type">“exit-on-close”</span></a> for more details.</p> <p>Note that this function should be used with care. Most modern UNIX desktops tie the notion of a user session with the session bus, and expect all of a user's applications to quit when their bus connection goes away. If you are setting <em class="parameter"><code>exit_on_close</code></em> to <code class="literal">FALSE</code> for the shared session bus connection, you should make sure that your application exits when the user session ends.</p> <div class="refsect3"> <a name="g-dbus-connection-set-exit-on-close.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>exit_on_close</p></td> <td class="parameter_description"><p>whether the process should be terminated when <em class="parameter"><code>connection</code></em> is closed by the remote peer</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-get-stream"></a><h3>g_dbus_connection_get_stream ()</h3> <pre class="programlisting"><a class="link" href="GIOStream.html" title="GIOStream"><span class="returnvalue">GIOStream</span></a> * g_dbus_connection_get_stream (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>);</pre> <p>Gets the underlying stream used for IO.</p> <p>While the <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> is active, it will interact with this stream from a worker thread, so it is not safe to interact with the stream directly.</p> <div class="refsect3"> <a name="g-dbus-connection-get-stream.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-get-stream.returns"></a><h4>Returns</h4> <p>the stream used for IO. </p> <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-get-flags"></a><h3>g_dbus_connection_get_flags ()</h3> <pre class="programlisting"><a class="link" href="GDBusConnection.html#GDBusConnectionFlags" title="enum GDBusConnectionFlags"><span class="returnvalue">GDBusConnectionFlags</span></a> g_dbus_connection_get_flags (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>);</pre> <p>Gets the flags used to construct this connection</p> <div class="refsect3"> <a name="g-dbus-connection-get-flags.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-get-flags.returns"></a><h4>Returns</h4> <p> zero or more flags from the <a class="link" href="GDBusConnection.html#GDBusConnectionFlags" title="enum GDBusConnectionFlags"><span class="type">GDBusConnectionFlags</span></a> enumeration</p> </div> <p class="since">Since: <a class="link" href="api-index-2-60.html#api-index-2.60">2.60</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-get-guid"></a><h3>g_dbus_connection_get_guid ()</h3> <pre class="programlisting">const <span class="returnvalue">gchar</span> * g_dbus_connection_get_guid (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>);</pre> <p>The GUID of the peer performing the role of server when authenticating. See <a class="link" href="GDBusConnection.html#GDBusConnection--guid" title="The “guid” property"><span class="type">“guid”</span></a> for more details.</p> <div class="refsect3"> <a name="g-dbus-connection-get-guid.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-get-guid.returns"></a><h4>Returns</h4> <p> The GUID. Do not free this string, it is owned by <em class="parameter"><code>connection</code></em> .</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-get-unique-name"></a><h3>g_dbus_connection_get_unique_name ()</h3> <pre class="programlisting">const <span class="returnvalue">gchar</span> * g_dbus_connection_get_unique_name (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>);</pre> <p>Gets the unique name of <em class="parameter"><code>connection</code></em> as assigned by the message bus. This can also be used to figure out if <em class="parameter"><code>connection</code></em> is a message bus connection.</p> <div class="refsect3"> <a name="g-dbus-connection-get-unique-name.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-get-unique-name.returns"></a><h4>Returns</h4> <p>the unique name or <code class="literal">NULL</code> if <em class="parameter"><code>connection</code></em> is not a message bus connection. Do not free this string, it is owned by <em class="parameter"><code>connection</code></em> . </p> <p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-get-capabilities"></a><h3>g_dbus_connection_get_capabilities ()</h3> <pre class="programlisting"><a class="link" href="GDBusConnection.html#GDBusCapabilityFlags" title="enum GDBusCapabilityFlags"><span class="returnvalue">GDBusCapabilityFlags</span></a> g_dbus_connection_get_capabilities (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>);</pre> <p>Gets the capabilities negotiated with the remote peer</p> <div class="refsect3"> <a name="g-dbus-connection-get-capabilities.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-get-capabilities.returns"></a><h4>Returns</h4> <p> zero or more flags from the <a class="link" href="GDBusConnection.html#GDBusCapabilityFlags" title="enum GDBusCapabilityFlags"><span class="type">GDBusCapabilityFlags</span></a> enumeration</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-get-peer-credentials"></a><h3>g_dbus_connection_get_peer_credentials ()</h3> <pre class="programlisting"><a class="link" href="GCredentials.html" title="GCredentials"><span class="returnvalue">GCredentials</span></a> * g_dbus_connection_get_peer_credentials (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>);</pre> <p>Gets the credentials of the authenticated peer. This will always return <code class="literal">NULL</code> unless <em class="parameter"><code>connection</code></em> acted as a server (e.g. <a class="link" href="GDBusConnection.html#G-DBUS-CONNECTION-FLAGS-AUTHENTICATION-SERVER:CAPS"><code class="literal">G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER</code></a> was passed) when set up and the client passed credentials as part of the authentication process.</p> <p>In a message bus setup, the message bus is always the server and each application is a client. So this method will always return <code class="literal">NULL</code> for message bus clients.</p> <div class="refsect3"> <a name="g-dbus-connection-get-peer-credentials.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-get-peer-credentials.returns"></a><h4>Returns</h4> <p>a <a class="link" href="GCredentials.html" title="GCredentials"><span class="type">GCredentials</span></a> or <code class="literal">NULL</code> if not available. Do not free this object, it is owned by <em class="parameter"><code>connection</code></em> . </p> <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-get-last-serial"></a><h3>g_dbus_connection_get_last_serial ()</h3> <pre class="programlisting"><span class="returnvalue">guint32</span> g_dbus_connection_get_last_serial (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>);</pre> <p>Retrieves the last serial number assigned to a <a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="type">GDBusMessage</span></a> on the current thread. This includes messages sent via both low-level API such as <a class="link" href="GDBusConnection.html#g-dbus-connection-send-message" title="g_dbus_connection_send_message ()"><code class="function">g_dbus_connection_send_message()</code></a> as well as high-level API such as <a class="link" href="GDBusConnection.html#g-dbus-connection-emit-signal" title="g_dbus_connection_emit_signal ()"><code class="function">g_dbus_connection_emit_signal()</code></a>, <a class="link" href="GDBusConnection.html#g-dbus-connection-call" title="g_dbus_connection_call ()"><code class="function">g_dbus_connection_call()</code></a> or <a class="link" href="GDBusProxy.html#g-dbus-proxy-call" title="g_dbus_proxy_call ()"><code class="function">g_dbus_proxy_call()</code></a>.</p> <div class="refsect3"> <a name="g-dbus-connection-get-last-serial.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody><tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr></tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-get-last-serial.returns"></a><h4>Returns</h4> <p> the last used serial or zero when no message has been sent within the current thread</p> </div> <p class="since">Since: <a class="link" href="api-index-2-34.html#api-index-2.34">2.34</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-call"></a><h3>g_dbus_connection_call ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_dbus_connection_call (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *bus_name</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *object_path</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *interface_name</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *method_name</code></em>, <em class="parameter"><code><span class="type">GVariant</span> *parameters</code></em>, <em class="parameter"><code>const <span class="type">GVariantType</span> *reply_type</code></em>, <em class="parameter"><code><a class="link" href="GDBusConnection.html#GDBusCallFlags" title="enum GDBusCallFlags"><span class="type">GDBusCallFlags</span></a> flags</code></em>, <em class="parameter"><code><span class="type">gint</span> timeout_msec</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously invokes the <em class="parameter"><code>method_name</code></em> method on the <em class="parameter"><code>interface_name</code></em> D-Bus interface on the remote object at <em class="parameter"><code>object_path</code></em> owned by <em class="parameter"><code>bus_name</code></em> .</p> <p>If <em class="parameter"><code>connection</code></em> is closed then the operation will fail with <a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED:CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a>. If <em class="parameter"><code>cancellable</code></em> is canceled, the operation will fail with <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a>. If <em class="parameter"><code>parameters</code></em> contains a value not compatible with the D-Bus protocol, the operation fails with <a class="link" href="gio-GIOError.html#G-IO-ERROR-INVALID-ARGUMENT:CAPS"><code class="literal">G_IO_ERROR_INVALID_ARGUMENT</code></a>.</p> <p>If <em class="parameter"><code>reply_type</code></em> is non-<code class="literal">NULL</code> then the reply will be checked for having this type and an error will be raised if it does not match. Said another way, if you give a <em class="parameter"><code>reply_type</code></em> then any non-<code class="literal">NULL</code> return value will be of this type. Unless it’s <code class="literal">G_VARIANT_TYPE_UNIT</code>, the <em class="parameter"><code>reply_type</code></em> will be a tuple containing one or more values.</p> <p>If the <em class="parameter"><code>parameters</code></em> <span class="type">GVariant</span> is floating, it is consumed. This allows convenient 'inline' use of <code class="function">g_variant_new()</code>, e.g.:</p> <div class="informalexample"> <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td class="listing_lines" align="right"><pre>1 2 3 4 5 6 7 8 9 10 11 12 13 14</pre></td> <td class="listing_code"><pre class="programlisting"><span class="n">g_dbus_connection_call</span> <span class="p">(</span><span class="n">connection</span><span class="p">,</span> <span class="s">"org.freedesktop.StringThings"</span><span class="p">,</span> <span class="s">"/org/freedesktop/StringThings"</span><span class="p">,</span> <span class="s">"org.freedesktop.StringThings"</span><span class="p">,</span> <span class="s">"TwoStrings"</span><span class="p">,</span> <span class="n">g_variant_new</span> <span class="p">(</span><span class="s">"(ss)"</span><span class="p">,</span> <span class="s">"Thing One"</span><span class="p">,</span> <span class="s">"Thing Two"</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">,</span> <span class="n">G_DBUS_CALL_FLAGS_NONE</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="p">(</span><span class="n">GAsyncReadyCallback</span><span class="p">)</span> <span class="n">two_strings_done</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">);</span></pre></td> </tr> </tbody> </table> </div> <p></p> <p>This is an asynchronous method. When the operation is finished, <em class="parameter"><code>callback</code></em> will be invoked in the thread-default main context of the thread you are calling this method from. You can then call <a class="link" href="GDBusConnection.html#g-dbus-connection-call-finish" title="g_dbus_connection_call_finish ()"><code class="function">g_dbus_connection_call_finish()</code></a> to get the result of the operation. See <a class="link" href="GDBusConnection.html#g-dbus-connection-call-sync" title="g_dbus_connection_call_sync ()"><code class="function">g_dbus_connection_call_sync()</code></a> for the synchronous version of this function.</p> <p>If <em class="parameter"><code>callback</code></em> is <code class="literal">NULL</code> then the D-Bus method call message will be sent with the <a class="link" href="GDBusMessage.html#G-DBUS-MESSAGE-FLAGS-NO-REPLY-EXPECTED:CAPS"><code class="literal">G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED</code></a> flag set.</p> <div class="refsect3"> <a name="g-dbus-connection-call.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>bus_name</p></td> <td class="parameter_description"><p>a unique or well-known bus name or <code class="literal">NULL</code> if <em class="parameter"><code>connection</code></em> is not a message bus connection. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>object_path</p></td> <td class="parameter_description"><p>path of remote object</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>interface_name</p></td> <td class="parameter_description"><p>D-Bus interface to invoke method on</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>method_name</p></td> <td class="parameter_description"><p>the name of the method to invoke</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>parameters</p></td> <td class="parameter_description"><p>a <span class="type">GVariant</span> tuple with parameters for the method or <code class="literal">NULL</code> if not passing parameters. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>reply_type</p></td> <td class="parameter_description"><p>the expected type of the reply (which will be a tuple), or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags from the <a class="link" href="GDBusConnection.html#GDBusCallFlags" title="enum GDBusCallFlags"><span class="type">GDBusCallFlags</span></a> enumeration</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>timeout_msec</p></td> <td class="parameter_description"><p>the timeout in milliseconds, -1 to use the default timeout or <code class="literal">G_MAXINT</code> for no timeout</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied or <code class="literal">NULL</code> if you don't care about the result of the method invocation. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>the data to pass to <em class="parameter"><code>callback</code></em> </p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-call-finish"></a><h3>g_dbus_connection_call_finish ()</h3> <pre class="programlisting"><span class="returnvalue">GVariant</span> * g_dbus_connection_call_finish (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an operation started with <a class="link" href="GDBusConnection.html#g-dbus-connection-call" title="g_dbus_connection_call ()"><code class="function">g_dbus_connection_call()</code></a>.</p> <div class="refsect3"> <a name="g-dbus-connection-call-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> obtained from the <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> passed to <a class="link" href="GDBusConnection.html#g-dbus-connection-call" title="g_dbus_connection_call ()"><code class="function">g_dbus_connection_call()</code></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-call-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">NULL</code> if <em class="parameter"><code>error</code></em> is set. Otherwise a <span class="type">GVariant</span> tuple with return values. Free with <code class="function">g_variant_unref()</code>.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-call-sync"></a><h3>g_dbus_connection_call_sync ()</h3> <pre class="programlisting"><span class="returnvalue">GVariant</span> * g_dbus_connection_call_sync (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *bus_name</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *object_path</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *interface_name</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *method_name</code></em>, <em class="parameter"><code><span class="type">GVariant</span> *parameters</code></em>, <em class="parameter"><code>const <span class="type">GVariantType</span> *reply_type</code></em>, <em class="parameter"><code><a class="link" href="GDBusConnection.html#GDBusCallFlags" title="enum GDBusCallFlags"><span class="type">GDBusCallFlags</span></a> flags</code></em>, <em class="parameter"><code><span class="type">gint</span> timeout_msec</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Synchronously invokes the <em class="parameter"><code>method_name</code></em> method on the <em class="parameter"><code>interface_name</code></em> D-Bus interface on the remote object at <em class="parameter"><code>object_path</code></em> owned by <em class="parameter"><code>bus_name</code></em> .</p> <p>If <em class="parameter"><code>connection</code></em> is closed then the operation will fail with <a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED:CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a>. If <em class="parameter"><code>cancellable</code></em> is canceled, the operation will fail with <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a>. If <em class="parameter"><code>parameters</code></em> contains a value not compatible with the D-Bus protocol, the operation fails with <a class="link" href="gio-GIOError.html#G-IO-ERROR-INVALID-ARGUMENT:CAPS"><code class="literal">G_IO_ERROR_INVALID_ARGUMENT</code></a>.</p> <p>If <em class="parameter"><code>reply_type</code></em> is non-<code class="literal">NULL</code> then the reply will be checked for having this type and an error will be raised if it does not match. Said another way, if you give a <em class="parameter"><code>reply_type</code></em> then any non-<code class="literal">NULL</code> return value will be of this type.</p> <p>If the <em class="parameter"><code>parameters</code></em> <span class="type">GVariant</span> is floating, it is consumed. This allows convenient 'inline' use of <code class="function">g_variant_new()</code>, e.g.:</p> <div class="informalexample"> <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td class="listing_lines" align="right"><pre>1 2 3 4 5 6 7 8 9 10 11 12 13</pre></td> <td class="listing_code"><pre class="programlisting"><span class="n">g_dbus_connection_call_sync</span> <span class="p">(</span><span class="n">connection</span><span class="p">,</span> <span class="s">"org.freedesktop.StringThings"</span><span class="p">,</span> <span class="s">"/org/freedesktop/StringThings"</span><span class="p">,</span> <span class="s">"org.freedesktop.StringThings"</span><span class="p">,</span> <span class="s">"TwoStrings"</span><span class="p">,</span> <span class="n">g_variant_new</span> <span class="p">(</span><span class="s">"(ss)"</span><span class="p">,</span> <span class="s">"Thing One"</span><span class="p">,</span> <span class="s">"Thing Two"</span><span class="p">),</span> <span class="nb">NULL</span><span class="p">,</span> <span class="n">G_DBUS_CALL_FLAGS_NONE</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="nb">NULL</span><span class="p">,</span> <span class="o">&</span><span class="n">error</span><span class="p">);</span></pre></td> </tr> </tbody> </table> </div> <p></p> <p>The calling thread is blocked until a reply is received. See <a class="link" href="GDBusConnection.html#g-dbus-connection-call" title="g_dbus_connection_call ()"><code class="function">g_dbus_connection_call()</code></a> for the asynchronous version of this method.</p> <div class="refsect3"> <a name="g-dbus-connection-call-sync.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>bus_name</p></td> <td class="parameter_description"><p>a unique or well-known bus name or <code class="literal">NULL</code> if <em class="parameter"><code>connection</code></em> is not a message bus connection. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>object_path</p></td> <td class="parameter_description"><p>path of remote object</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>interface_name</p></td> <td class="parameter_description"><p>D-Bus interface to invoke method on</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>method_name</p></td> <td class="parameter_description"><p>the name of the method to invoke</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>parameters</p></td> <td class="parameter_description"><p>a <span class="type">GVariant</span> tuple with parameters for the method or <code class="literal">NULL</code> if not passing parameters. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>reply_type</p></td> <td class="parameter_description"><p>the expected type of the reply, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags from the <a class="link" href="GDBusConnection.html#GDBusCallFlags" title="enum GDBusCallFlags"><span class="type">GDBusCallFlags</span></a> enumeration</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>timeout_msec</p></td> <td class="parameter_description"><p>the timeout in milliseconds, -1 to use the default timeout or <code class="literal">G_MAXINT</code> for no timeout</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-call-sync.returns"></a><h4>Returns</h4> <p> <code class="literal">NULL</code> if <em class="parameter"><code>error</code></em> is set. Otherwise a <span class="type">GVariant</span> tuple with return values. Free with <code class="function">g_variant_unref()</code>.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-call-with-unix-fd-list"></a><h3>g_dbus_connection_call_with_unix_fd_list ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_dbus_connection_call_with_unix_fd_list (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *bus_name</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *object_path</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *interface_name</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *method_name</code></em>, <em class="parameter"><code><span class="type">GVariant</span> *parameters</code></em>, <em class="parameter"><code>const <span class="type">GVariantType</span> *reply_type</code></em>, <em class="parameter"><code><a class="link" href="GDBusConnection.html#GDBusCallFlags" title="enum GDBusCallFlags"><span class="type">GDBusCallFlags</span></a> flags</code></em>, <em class="parameter"><code><span class="type">gint</span> timeout_msec</code></em>, <em class="parameter"><code><a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a> *fd_list</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Like <a class="link" href="GDBusConnection.html#g-dbus-connection-call" title="g_dbus_connection_call ()"><code class="function">g_dbus_connection_call()</code></a> but also takes a <a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a> object.</p> <p>This method is only available on UNIX.</p> <div class="refsect3"> <a name="g-dbus-connection-call-with-unix-fd-list.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>bus_name</p></td> <td class="parameter_description"><p>a unique or well-known bus name or <code class="literal">NULL</code> if <em class="parameter"><code>connection</code></em> is not a message bus connection. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>object_path</p></td> <td class="parameter_description"><p>path of remote object</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>interface_name</p></td> <td class="parameter_description"><p>D-Bus interface to invoke method on</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>method_name</p></td> <td class="parameter_description"><p>the name of the method to invoke</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>parameters</p></td> <td class="parameter_description"><p>a <span class="type">GVariant</span> tuple with parameters for the method or <code class="literal">NULL</code> if not passing parameters. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>reply_type</p></td> <td class="parameter_description"><p>the expected type of the reply, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags from the <a class="link" href="GDBusConnection.html#GDBusCallFlags" title="enum GDBusCallFlags"><span class="type">GDBusCallFlags</span></a> enumeration</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>timeout_msec</p></td> <td class="parameter_description"><p>the timeout in milliseconds, -1 to use the default timeout or <code class="literal">G_MAXINT</code> for no timeout</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>fd_list</p></td> <td class="parameter_description"><p>a <a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied or <code class="literal">NULL</code> if you don't * care about the result of the method invocation. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>The data to pass to <em class="parameter"><code>callback</code></em> .</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-30.html#api-index-2.30">2.30</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-call-with-unix-fd-list-finish"></a><h3>g_dbus_connection_call_with_unix_fd_list_finish ()</h3> <pre class="programlisting"><span class="returnvalue">GVariant</span> * g_dbus_connection_call_with_unix_fd_list_finish (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code><a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a> **out_fd_list</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an operation started with <a class="link" href="GDBusConnection.html#g-dbus-connection-call-with-unix-fd-list" title="g_dbus_connection_call_with_unix_fd_list ()"><code class="function">g_dbus_connection_call_with_unix_fd_list()</code></a>.</p> <div class="refsect3"> <a name="g-dbus-connection-call-with-unix-fd-list-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>out_fd_list</p></td> <td class="parameter_description"><p>return location for a <a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> obtained from the <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> passed to <a class="link" href="GDBusConnection.html#g-dbus-connection-call-with-unix-fd-list" title="g_dbus_connection_call_with_unix_fd_list ()"><code class="function">g_dbus_connection_call_with_unix_fd_list()</code></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-call-with-unix-fd-list-finish.returns"></a><h4>Returns</h4> <p> <code class="literal">NULL</code> if <em class="parameter"><code>error</code></em> is set. Otherwise a <span class="type">GVariant</span> tuple with return values. Free with <code class="function">g_variant_unref()</code>.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-30.html#api-index-2.30">2.30</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-call-with-unix-fd-list-sync"></a><h3>g_dbus_connection_call_with_unix_fd_list_sync ()</h3> <pre class="programlisting"><span class="returnvalue">GVariant</span> * g_dbus_connection_call_with_unix_fd_list_sync (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *bus_name</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *object_path</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *interface_name</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *method_name</code></em>, <em class="parameter"><code><span class="type">GVariant</span> *parameters</code></em>, <em class="parameter"><code>const <span class="type">GVariantType</span> *reply_type</code></em>, <em class="parameter"><code><a class="link" href="GDBusConnection.html#GDBusCallFlags" title="enum GDBusCallFlags"><span class="type">GDBusCallFlags</span></a> flags</code></em>, <em class="parameter"><code><span class="type">gint</span> timeout_msec</code></em>, <em class="parameter"><code><a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a> *fd_list</code></em>, <em class="parameter"><code><a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a> **out_fd_list</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Like <a class="link" href="GDBusConnection.html#g-dbus-connection-call-sync" title="g_dbus_connection_call_sync ()"><code class="function">g_dbus_connection_call_sync()</code></a> but also takes and returns <a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a> objects.</p> <p>This method is only available on UNIX.</p> <div class="refsect3"> <a name="g-dbus-connection-call-with-unix-fd-list-sync.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>bus_name</p></td> <td class="parameter_description"><p>a unique or well-known bus name or <code class="literal">NULL</code> if <em class="parameter"><code>connection</code></em> is not a message bus connection. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>object_path</p></td> <td class="parameter_description"><p>path of remote object</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>interface_name</p></td> <td class="parameter_description"><p>D-Bus interface to invoke method on</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>method_name</p></td> <td class="parameter_description"><p>the name of the method to invoke</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>parameters</p></td> <td class="parameter_description"><p>a <span class="type">GVariant</span> tuple with parameters for the method or <code class="literal">NULL</code> if not passing parameters. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>reply_type</p></td> <td class="parameter_description"><p>the expected type of the reply, or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags from the <a class="link" href="GDBusConnection.html#GDBusCallFlags" title="enum GDBusCallFlags"><span class="type">GDBusCallFlags</span></a> enumeration</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>timeout_msec</p></td> <td class="parameter_description"><p>the timeout in milliseconds, -1 to use the default timeout or <code class="literal">G_MAXINT</code> for no timeout</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>fd_list</p></td> <td class="parameter_description"><p>a <a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>out_fd_list</p></td> <td class="parameter_description"><p>return location for a <a class="link" href="GUnixFDList.html" title="GUnixFDList"><span class="type">GUnixFDList</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-call-with-unix-fd-list-sync.returns"></a><h4>Returns</h4> <p> <code class="literal">NULL</code> if <em class="parameter"><code>error</code></em> is set. Otherwise a <span class="type">GVariant</span> tuple with return values. Free with <code class="function">g_variant_unref()</code>.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-30.html#api-index-2.30">2.30</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-emit-signal"></a><h3>g_dbus_connection_emit_signal ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_dbus_connection_emit_signal (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *destination_bus_name</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *object_path</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *interface_name</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *signal_name</code></em>, <em class="parameter"><code><span class="type">GVariant</span> *parameters</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Emits a signal.</p> <p>If the parameters GVariant is floating, it is consumed.</p> <p>This can only fail if <em class="parameter"><code>parameters</code></em> is not compatible with the D-Bus protocol (<a class="link" href="gio-GIOError.html#G-IO-ERROR-INVALID-ARGUMENT:CAPS"><code class="literal">G_IO_ERROR_INVALID_ARGUMENT</code></a>), or if <em class="parameter"><code>connection</code></em> has been closed (<a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED:CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a>).</p> <div class="refsect3"> <a name="g-dbus-connection-emit-signal.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>destination_bus_name</p></td> <td class="parameter_description"><p>the unique bus name for the destination for the signal or <code class="literal">NULL</code> to emit to all listeners. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>object_path</p></td> <td class="parameter_description"><p>path of remote object</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>interface_name</p></td> <td class="parameter_description"><p>D-Bus interface to emit a signal on</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>signal_name</p></td> <td class="parameter_description"><p>the name of the signal to emit</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>parameters</p></td> <td class="parameter_description"><p>a <span class="type">GVariant</span> tuple with parameters for the signal or <code class="literal">NULL</code> if not passing parameters. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>Return location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-emit-signal.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> unless <em class="parameter"><code>error</code></em> is set</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusSignalCallback"></a><h3>GDBusSignalCallback ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> <span class="c_punctuation">(</span>*GDBusSignalCallback<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *sender_name</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *object_path</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *interface_name</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *signal_name</code></em>, <em class="parameter"><code><span class="type">GVariant</span> *parameters</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Signature for callback function used in <a class="link" href="GDBusConnection.html#g-dbus-connection-signal-subscribe" title="g_dbus_connection_signal_subscribe ()"><code class="function">g_dbus_connection_signal_subscribe()</code></a>.</p> <div class="refsect3"> <a name="GDBusSignalCallback.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>A <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a>.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>sender_name</p></td> <td class="parameter_description"><p>The unique bus name of the sender of the signal.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>object_path</p></td> <td class="parameter_description"><p>The object path that the signal was emitted on.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>interface_name</p></td> <td class="parameter_description"><p>The name of the interface.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>signal_name</p></td> <td class="parameter_description"><p>The name of the signal.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>parameters</p></td> <td class="parameter_description"><p>A <span class="type">GVariant</span> tuple with parameters for the signal.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>User data passed when subscribing to the signal.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-signal-subscribe"></a><h3>g_dbus_connection_signal_subscribe ()</h3> <pre class="programlisting"><span class="returnvalue">guint</span> g_dbus_connection_signal_subscribe (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *sender</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *interface_name</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *member</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *object_path</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *arg0</code></em>, <em class="parameter"><code><a class="link" href="GDBusConnection.html#GDBusSignalFlags" title="enum GDBusSignalFlags"><span class="type">GDBusSignalFlags</span></a> flags</code></em>, <em class="parameter"><code><a class="link" href="GDBusConnection.html#GDBusSignalCallback" title="GDBusSignalCallback ()"><span class="type">GDBusSignalCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>, <em class="parameter"><code><span class="type">GDestroyNotify</span> user_data_free_func</code></em>);</pre> <p>Subscribes to signals on <em class="parameter"><code>connection</code></em> and invokes <em class="parameter"><code>callback</code></em> with a whenever the signal is received. Note that <em class="parameter"><code>callback</code></em> will be invoked in the thread-default main context of the thread you are calling this method from.</p> <p>If <em class="parameter"><code>connection</code></em> is not a message bus connection, <em class="parameter"><code>sender</code></em> must be <code class="literal">NULL</code>.</p> <p>If <em class="parameter"><code>sender</code></em> is a well-known name note that <em class="parameter"><code>callback</code></em> is invoked with the unique name for the owner of <em class="parameter"><code>sender</code></em> , not the well-known name as one would expect. This is because the message bus rewrites the name. As such, to avoid certain race conditions, users should be tracking the name owner of the well-known name and use that when processing the received signal.</p> <p>If one of <a class="link" href="GDBusConnection.html#G-DBUS-SIGNAL-FLAGS-MATCH-ARG0-NAMESPACE:CAPS"><code class="literal">G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_NAMESPACE</code></a> or <a class="link" href="GDBusConnection.html#G-DBUS-SIGNAL-FLAGS-MATCH-ARG0-PATH:CAPS"><code class="literal">G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH</code></a> are given, <em class="parameter"><code>arg0</code></em> is interpreted as part of a namespace or path. The first argument of a signal is matched against that part as specified by D-Bus.</p> <p>If <em class="parameter"><code>user_data_free_func</code></em> is non-<code class="literal">NULL</code>, it will be called (in the thread-default main context of the thread you are calling this method from) at some point after <em class="parameter"><code>user_data</code></em> is no longer needed. (It is not guaranteed to be called synchronously when the signal is unsubscribed from, and may be called after <em class="parameter"><code>connection</code></em> has been destroyed.)</p> <p>As <em class="parameter"><code>callback</code></em> is potentially invoked in a different thread from where it’s emitted, it’s possible for this to happen after <a class="link" href="GDBusConnection.html#g-dbus-connection-signal-unsubscribe" title="g_dbus_connection_signal_unsubscribe ()"><code class="function">g_dbus_connection_signal_unsubscribe()</code></a> has been called in another thread. Due to this, <em class="parameter"><code>user_data</code></em> should have a strong reference which is freed with <em class="parameter"><code>user_data_free_func</code></em> , rather than pointing to data whose lifecycle is tied to the signal subscription. For example, if a <span class="type">GObject</span> is used to store the subscription ID from <a class="link" href="GDBusConnection.html#g-dbus-connection-signal-subscribe" title="g_dbus_connection_signal_subscribe ()"><code class="function">g_dbus_connection_signal_subscribe()</code></a>, a strong reference to that <span class="type">GObject</span> must be passed to <em class="parameter"><code>user_data</code></em> , and <code class="function">g_object_unref()</code> passed to <em class="parameter"><code>user_data_free_func</code></em> . You are responsible for breaking the resulting reference count cycle by explicitly unsubscribing from the signal when dropping the last external reference to the <span class="type">GObject</span>. Alternatively, a weak reference may be used.</p> <p>It is guaranteed that if you unsubscribe from a signal using <a class="link" href="GDBusConnection.html#g-dbus-connection-signal-unsubscribe" title="g_dbus_connection_signal_unsubscribe ()"><code class="function">g_dbus_connection_signal_unsubscribe()</code></a> from the same thread which made the corresponding <a class="link" href="GDBusConnection.html#g-dbus-connection-signal-subscribe" title="g_dbus_connection_signal_subscribe ()"><code class="function">g_dbus_connection_signal_subscribe()</code></a> call, <em class="parameter"><code>callback</code></em> will not be invoked after <a class="link" href="GDBusConnection.html#g-dbus-connection-signal-unsubscribe" title="g_dbus_connection_signal_unsubscribe ()"><code class="function">g_dbus_connection_signal_unsubscribe()</code></a> returns.</p> <p>The returned subscription identifier is an opaque value which is guaranteed to never be zero.</p> <p>This function can never fail.</p> <div class="refsect3"> <a name="g-dbus-connection-signal-subscribe.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>sender</p></td> <td class="parameter_description"><p>sender name to match on (unique or well-known name) or <code class="literal">NULL</code> to listen from all senders. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>interface_name</p></td> <td class="parameter_description"><p>D-Bus interface name to match on or <code class="literal">NULL</code> to match on all interfaces. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>member</p></td> <td class="parameter_description"><p>D-Bus signal name to match on or <code class="literal">NULL</code> to match on all signals. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>object_path</p></td> <td class="parameter_description"><p>object path to match on or <code class="literal">NULL</code> to match on all object paths. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>arg0</p></td> <td class="parameter_description"><p>contents of first string argument to match on or <code class="literal">NULL</code> to match on all kinds of arguments. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p><a class="link" href="GDBusConnection.html#GDBusSignalFlags" title="enum GDBusSignalFlags"><span class="type">GDBusSignalFlags</span></a> describing how arg0 is used in subscribing to the signal</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>callback to invoke when there is a signal matching the requested data</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>user data to pass to <em class="parameter"><code>callback</code></em> </p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data_free_func</p></td> <td class="parameter_description"><p>function to free <em class="parameter"><code>user_data</code></em> with when subscription is removed or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-signal-subscribe.returns"></a><h4>Returns</h4> <p> a subscription identifier that can be used with <a class="link" href="GDBusConnection.html#g-dbus-connection-signal-unsubscribe" title="g_dbus_connection_signal_unsubscribe ()"><code class="function">g_dbus_connection_signal_unsubscribe()</code></a></p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-signal-unsubscribe"></a><h3>g_dbus_connection_signal_unsubscribe ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_dbus_connection_signal_unsubscribe (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code><span class="type">guint</span> subscription_id</code></em>);</pre> <p>Unsubscribes from signals.</p> <p>Note that there may still be D-Bus traffic to process (relating to this signal subscription) in the current thread-default <span class="type">GMainContext</span> after this function has returned. You should continue to iterate the <span class="type">GMainContext</span> until the <span class="type">GDestroyNotify</span> function passed to <a class="link" href="GDBusConnection.html#g-dbus-connection-signal-subscribe" title="g_dbus_connection_signal_subscribe ()"><code class="function">g_dbus_connection_signal_subscribe()</code></a> is called, in order to avoid memory leaks through callbacks queued on the <span class="type">GMainContext</span> after it’s stopped being iterated.</p> <div class="refsect3"> <a name="g-dbus-connection-signal-unsubscribe.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>subscription_id</p></td> <td class="parameter_description"><p>a subscription id obtained from <a class="link" href="GDBusConnection.html#g-dbus-connection-signal-subscribe" title="g_dbus_connection_signal_subscribe ()"><code class="function">g_dbus_connection_signal_subscribe()</code></a></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-send-message"></a><h3>g_dbus_connection_send_message ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_dbus_connection_send_message (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code><a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="type">GDBusMessage</span></a> *message</code></em>, <em class="parameter"><code><a class="link" href="GDBusConnection.html#GDBusSendMessageFlags" title="enum GDBusSendMessageFlags"><span class="type">GDBusSendMessageFlags</span></a> flags</code></em>, <em class="parameter"><code>volatile <span class="type">guint32</span> *out_serial</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Asynchronously sends <em class="parameter"><code>message</code></em> to the peer represented by <em class="parameter"><code>connection</code></em> .</p> <p>Unless <em class="parameter"><code>flags</code></em> contain the <a class="link" href="GDBusConnection.html#G-DBUS-SEND-MESSAGE-FLAGS-PRESERVE-SERIAL:CAPS"><code class="literal">G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL</code></a> flag, the serial number will be assigned by <em class="parameter"><code>connection</code></em> and set on <em class="parameter"><code>message</code></em> via <a class="link" href="GDBusMessage.html#g-dbus-message-set-serial" title="g_dbus_message_set_serial ()"><code class="function">g_dbus_message_set_serial()</code></a>. If <em class="parameter"><code>out_serial</code></em> is not <code class="literal">NULL</code>, then the serial number used will be written to this location prior to submitting the message to the underlying transport.</p> <p>If <em class="parameter"><code>connection</code></em> is closed then the operation will fail with <a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED:CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a>. If <em class="parameter"><code>message</code></em> is not well-formed, the operation fails with <a class="link" href="gio-GIOError.html#G-IO-ERROR-INVALID-ARGUMENT:CAPS"><code class="literal">G_IO_ERROR_INVALID_ARGUMENT</code></a>.</p> <p>See this <a class="link" href="GDBusConnection.html#gdbus-server" title="An example D-Bus server">server</a> and <a class="link" href="GDBusConnection.html#gdbus-unix-fd-client" title="An example for file descriptor passing">client</a> for an example of how to use this low-level API to send and receive UNIX file descriptors.</p> <p>Note that <em class="parameter"><code>message</code></em> must be unlocked, unless <em class="parameter"><code>flags</code></em> contain the <a class="link" href="GDBusConnection.html#G-DBUS-SEND-MESSAGE-FLAGS-PRESERVE-SERIAL:CAPS"><code class="literal">G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL</code></a> flag.</p> <div class="refsect3"> <a name="g-dbus-connection-send-message.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>message</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="type">GDBusMessage</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags affecting how the message is sent</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>out_serial</p></td> <td class="parameter_description"><p>return location for serial number assigned to <em class="parameter"><code>message</code></em> when sending it or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>Return location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-send-message.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the message was well-formed and queued for transmission, <code class="literal">FALSE</code> if <em class="parameter"><code>error</code></em> is set</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-send-message-with-reply"></a><h3>g_dbus_connection_send_message_with_reply ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_dbus_connection_send_message_with_reply (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code><a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="type">GDBusMessage</span></a> *message</code></em>, <em class="parameter"><code><a class="link" href="GDBusConnection.html#GDBusSendMessageFlags" title="enum GDBusSendMessageFlags"><span class="type">GDBusSendMessageFlags</span></a> flags</code></em>, <em class="parameter"><code><span class="type">gint</span> timeout_msec</code></em>, <em class="parameter"><code>volatile <span class="type">guint32</span> *out_serial</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Asynchronously sends <em class="parameter"><code>message</code></em> to the peer represented by <em class="parameter"><code>connection</code></em> .</p> <p>Unless <em class="parameter"><code>flags</code></em> contain the <a class="link" href="GDBusConnection.html#G-DBUS-SEND-MESSAGE-FLAGS-PRESERVE-SERIAL:CAPS"><code class="literal">G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL</code></a> flag, the serial number will be assigned by <em class="parameter"><code>connection</code></em> and set on <em class="parameter"><code>message</code></em> via <a class="link" href="GDBusMessage.html#g-dbus-message-set-serial" title="g_dbus_message_set_serial ()"><code class="function">g_dbus_message_set_serial()</code></a>. If <em class="parameter"><code>out_serial</code></em> is not <code class="literal">NULL</code>, then the serial number used will be written to this location prior to submitting the message to the underlying transport.</p> <p>If <em class="parameter"><code>connection</code></em> is closed then the operation will fail with <a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED:CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a>. If <em class="parameter"><code>cancellable</code></em> is canceled, the operation will fail with <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a>. If <em class="parameter"><code>message</code></em> is not well-formed, the operation fails with <a class="link" href="gio-GIOError.html#G-IO-ERROR-INVALID-ARGUMENT:CAPS"><code class="literal">G_IO_ERROR_INVALID_ARGUMENT</code></a>.</p> <p>This is an asynchronous method. When the operation is finished, <em class="parameter"><code>callback</code></em> will be invoked in the thread-default main context of the thread you are calling this method from. You can then call <a class="link" href="GDBusConnection.html#g-dbus-connection-send-message-with-reply-finish" title="g_dbus_connection_send_message_with_reply_finish ()"><code class="function">g_dbus_connection_send_message_with_reply_finish()</code></a> to get the result of the operation. See <a class="link" href="GDBusConnection.html#g-dbus-connection-send-message-with-reply-sync" title="g_dbus_connection_send_message_with_reply_sync ()"><code class="function">g_dbus_connection_send_message_with_reply_sync()</code></a> for the synchronous version.</p> <p>Note that <em class="parameter"><code>message</code></em> must be unlocked, unless <em class="parameter"><code>flags</code></em> contain the <a class="link" href="GDBusConnection.html#G-DBUS-SEND-MESSAGE-FLAGS-PRESERVE-SERIAL:CAPS"><code class="literal">G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL</code></a> flag.</p> <p>See this <a class="link" href="GDBusConnection.html#gdbus-server" title="An example D-Bus server">server</a> and <a class="link" href="GDBusConnection.html#gdbus-unix-fd-client" title="An example for file descriptor passing">client</a> for an example of how to use this low-level API to send and receive UNIX file descriptors.</p> <div class="refsect3"> <a name="g-dbus-connection-send-message-with-reply.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>message</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="type">GDBusMessage</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags affecting how the message is sent</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>timeout_msec</p></td> <td class="parameter_description"><p>the timeout in milliseconds, -1 to use the default timeout or <code class="literal">G_MAXINT</code> for no timeout</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>out_serial</p></td> <td class="parameter_description"><p>return location for serial number assigned to <em class="parameter"><code>message</code></em> when sending it or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>callback</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied or <code class="literal">NULL</code> if you don't care about the result. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>The data to pass to <em class="parameter"><code>callback</code></em> </p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-send-message-with-reply-finish"></a><h3>g_dbus_connection_send_message_with_reply_finish ()</h3> <pre class="programlisting"><a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="returnvalue">GDBusMessage</span></a> * g_dbus_connection_send_message_with_reply_finish (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *res</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Finishes an operation started with <a class="link" href="GDBusConnection.html#g-dbus-connection-send-message-with-reply" title="g_dbus_connection_send_message_with_reply ()"><code class="function">g_dbus_connection_send_message_with_reply()</code></a>.</p> <p>Note that <em class="parameter"><code>error</code></em> is only set if a local in-process error occurred. That is to say that the returned <a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="type">GDBusMessage</span></a> object may be of type <a class="link" href="GDBusMessage.html#G-DBUS-MESSAGE-TYPE-ERROR:CAPS"><code class="literal">G_DBUS_MESSAGE_TYPE_ERROR</code></a>. Use <a class="link" href="GDBusMessage.html#g-dbus-message-to-gerror" title="g_dbus_message_to_gerror ()"><code class="function">g_dbus_message_to_gerror()</code></a> to transcode this to a <span class="type">GError</span>.</p> <p>See this <a class="link" href="GDBusConnection.html#gdbus-server" title="An example D-Bus server">server</a> and <a class="link" href="GDBusConnection.html#gdbus-unix-fd-client" title="An example for file descriptor passing">client</a> for an example of how to use this low-level API to send and receive UNIX file descriptors.</p> <div class="refsect3"> <a name="g-dbus-connection-send-message-with-reply-finish.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>res</p></td> <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> obtained from the <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> passed to <a class="link" href="GDBusConnection.html#g-dbus-connection-send-message-with-reply" title="g_dbus_connection_send_message_with_reply ()"><code class="function">g_dbus_connection_send_message_with_reply()</code></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>teturn location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-send-message-with-reply-finish.returns"></a><h4>Returns</h4> <p>a locked <a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="type">GDBusMessage</span></a> or <code class="literal">NULL</code> if <em class="parameter"><code>error</code></em> is set. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-send-message-with-reply-sync"></a><h3>g_dbus_connection_send_message_with_reply_sync ()</h3> <pre class="programlisting"><a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="returnvalue">GDBusMessage</span></a> * g_dbus_connection_send_message_with_reply_sync (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code><a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="type">GDBusMessage</span></a> *message</code></em>, <em class="parameter"><code><a class="link" href="GDBusConnection.html#GDBusSendMessageFlags" title="enum GDBusSendMessageFlags"><span class="type">GDBusSendMessageFlags</span></a> flags</code></em>, <em class="parameter"><code><span class="type">gint</span> timeout_msec</code></em>, <em class="parameter"><code>volatile <span class="type">guint32</span> *out_serial</code></em>, <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Synchronously sends <em class="parameter"><code>message</code></em> to the peer represented by <em class="parameter"><code>connection</code></em> and blocks the calling thread until a reply is received or the timeout is reached. See <a class="link" href="GDBusConnection.html#g-dbus-connection-send-message-with-reply" title="g_dbus_connection_send_message_with_reply ()"><code class="function">g_dbus_connection_send_message_with_reply()</code></a> for the asynchronous version of this method.</p> <p>Unless <em class="parameter"><code>flags</code></em> contain the <a class="link" href="GDBusConnection.html#G-DBUS-SEND-MESSAGE-FLAGS-PRESERVE-SERIAL:CAPS"><code class="literal">G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL</code></a> flag, the serial number will be assigned by <em class="parameter"><code>connection</code></em> and set on <em class="parameter"><code>message</code></em> via <a class="link" href="GDBusMessage.html#g-dbus-message-set-serial" title="g_dbus_message_set_serial ()"><code class="function">g_dbus_message_set_serial()</code></a>. If <em class="parameter"><code>out_serial</code></em> is not <code class="literal">NULL</code>, then the serial number used will be written to this location prior to submitting the message to the underlying transport.</p> <p>If <em class="parameter"><code>connection</code></em> is closed then the operation will fail with <a class="link" href="gio-GIOError.html#G-IO-ERROR-CLOSED:CAPS"><code class="literal">G_IO_ERROR_CLOSED</code></a>. If <em class="parameter"><code>cancellable</code></em> is canceled, the operation will fail with <a class="link" href="gio-GIOError.html#G-IO-ERROR-CANCELLED:CAPS"><code class="literal">G_IO_ERROR_CANCELLED</code></a>. If <em class="parameter"><code>message</code></em> is not well-formed, the operation fails with <a class="link" href="gio-GIOError.html#G-IO-ERROR-INVALID-ARGUMENT:CAPS"><code class="literal">G_IO_ERROR_INVALID_ARGUMENT</code></a>.</p> <p>Note that <em class="parameter"><code>error</code></em> is only set if a local in-process error occurred. That is to say that the returned <a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="type">GDBusMessage</span></a> object may be of type <a class="link" href="GDBusMessage.html#G-DBUS-MESSAGE-TYPE-ERROR:CAPS"><code class="literal">G_DBUS_MESSAGE_TYPE_ERROR</code></a>. Use <a class="link" href="GDBusMessage.html#g-dbus-message-to-gerror" title="g_dbus_message_to_gerror ()"><code class="function">g_dbus_message_to_gerror()</code></a> to transcode this to a <span class="type">GError</span>.</p> <p>See this <a class="link" href="GDBusConnection.html#gdbus-server" title="An example D-Bus server">server</a> and <a class="link" href="GDBusConnection.html#gdbus-unix-fd-client" title="An example for file descriptor passing">client</a> for an example of how to use this low-level API to send and receive UNIX file descriptors.</p> <p>Note that <em class="parameter"><code>message</code></em> must be unlocked, unless <em class="parameter"><code>flags</code></em> contain the <a class="link" href="GDBusConnection.html#G-DBUS-SEND-MESSAGE-FLAGS-PRESERVE-SERIAL:CAPS"><code class="literal">G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL</code></a> flag.</p> <div class="refsect3"> <a name="g-dbus-connection-send-message-with-reply-sync.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>message</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="type">GDBusMessage</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags affecting how the message is sent.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>timeout_msec</p></td> <td class="parameter_description"><p>the timeout in milliseconds, -1 to use the default timeout or <code class="literal">G_MAXINT</code> for no timeout</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>out_serial</p></td> <td class="parameter_description"><p>return location for serial number assigned to <em class="parameter"><code>message</code></em> when sending it or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL may be passed instead of a pointer to a location."><span class="acronym">optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>cancellable</p></td> <td class="parameter_description"><p>a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-send-message-with-reply-sync.returns"></a><h4>Returns</h4> <p>a locked <a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="type">GDBusMessage</span></a> that is the reply to <em class="parameter"><code>message</code></em> or <code class="literal">NULL</code> if <em class="parameter"><code>error</code></em> is set. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusMessageFilterFunction"></a><h3>GDBusMessageFilterFunction ()</h3> <pre class="programlisting"><a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="returnvalue">GDBusMessage</span></a> * <span class="c_punctuation">(</span>*GDBusMessageFilterFunction<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code><a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="type">GDBusMessage</span></a> *message</code></em>, <em class="parameter"><code><span class="type">gboolean</span> incoming</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>Signature for function used in <a class="link" href="GDBusConnection.html#g-dbus-connection-add-filter" title="g_dbus_connection_add_filter ()"><code class="function">g_dbus_connection_add_filter()</code></a>.</p> <p>A filter function is passed a <a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="type">GDBusMessage</span></a> and expected to return a <a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="type">GDBusMessage</span></a> too. Passive filter functions that don't modify the message can simply return the <em class="parameter"><code>message</code></em> object:</p> <div class="informalexample"> <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td class="listing_lines" align="right"><pre>1 2 3 4 5 6 7 8 9</pre></td> <td class="listing_code"><pre class="programlisting"><span class="k">static</span> <span class="n">GDBusMessage</span> <span class="o">*</span> <span class="nf">passive_filter</span> <span class="p">(</span><span class="n">GDBusConnection</span> <span class="o">*</span><span class="n">connection</span> <span class="n">GDBusMessage</span> <span class="o">*</span><span class="n">message</span><span class="p">,</span> <span class="n">gboolean</span> <span class="n">incoming</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">user_data</span><span class="p">)</span> <span class="p">{</span> <span class="c1">// inspect @message</span> <span class="k">return</span> <span class="n">message</span><span class="p">;</span> <span class="p">}</span></pre></td> </tr> </tbody> </table> </div> <p> Filter functions that wants to drop a message can simply return <code class="literal">NULL</code>:</p> <div class="informalexample"> <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td class="listing_lines" align="right"><pre>1 2 3 4 5 6 7 8 9 10 11 12 13</pre></td> <td class="listing_code"><pre class="programlisting"><span class="k">static</span> <span class="n">GDBusMessage</span> <span class="o">*</span> <span class="nf">drop_filter</span> <span class="p">(</span><span class="n">GDBusConnection</span> <span class="o">*</span><span class="n">connection</span> <span class="n">GDBusMessage</span> <span class="o">*</span><span class="n">message</span><span class="p">,</span> <span class="n">gboolean</span> <span class="n">incoming</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">user_data</span><span class="p">)</span> <span class="p">{</span> <span class="k">if</span> <span class="p">(</span><span class="n">should_drop_message</span><span class="p">)</span> <span class="p">{</span> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">message</span><span class="p">);</span> <span class="n">message</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span> <span class="p">}</span> <span class="k">return</span> <span class="n">message</span><span class="p">;</span> <span class="p">}</span></pre></td> </tr> </tbody> </table> </div> <p> Finally, a filter function may modify a message by copying it:</p> <div class="informalexample"> <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td class="listing_lines" align="right"><pre>1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18</pre></td> <td class="listing_code"><pre class="programlisting"><span class="k">static</span> <span class="n">GDBusMessage</span> <span class="o">*</span> <span class="nf">modifying_filter</span> <span class="p">(</span><span class="n">GDBusConnection</span> <span class="o">*</span><span class="n">connection</span> <span class="n">GDBusMessage</span> <span class="o">*</span><span class="n">message</span><span class="p">,</span> <span class="n">gboolean</span> <span class="n">incoming</span><span class="p">,</span> <span class="n">gpointer</span> <span class="n">user_data</span><span class="p">)</span> <span class="p">{</span> <span class="n">GDBusMessage</span> <span class="o">*</span><span class="n">copy</span><span class="p">;</span> <span class="n">GError</span> <span class="o">*</span><span class="n">error</span><span class="p">;</span> <span class="n">error</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span> <span class="n">copy</span> <span class="o">=</span> <span class="n">g_dbus_message_copy</span> <span class="p">(</span><span class="n">message</span><span class="p">,</span> <span class="o">&</span><span class="n">error</span><span class="p">);</span> <span class="c1">// handle @error being set</span> <span class="n">g_object_unref</span> <span class="p">(</span><span class="n">message</span><span class="p">);</span> <span class="c1">// modify @copy</span> <span class="k">return</span> <span class="n">copy</span><span class="p">;</span> <span class="p">}</span></pre></td> </tr> </tbody> </table> </div> <p> If the returned <a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="type">GDBusMessage</span></a> is different from <em class="parameter"><code>message</code></em> and cannot be sent on <em class="parameter"><code>connection</code></em> (it could use features, such as file descriptors, not compatible with <em class="parameter"><code>connection</code></em> ), then a warning is logged to standard error. Applications can check this ahead of time using <a class="link" href="GDBusMessage.html#g-dbus-message-to-blob" title="g_dbus_message_to_blob ()"><code class="function">g_dbus_message_to_blob()</code></a> passing a <a class="link" href="GDBusConnection.html#GDBusCapabilityFlags" title="enum GDBusCapabilityFlags"><span class="type">GDBusCapabilityFlags</span></a> value obtained from <em class="parameter"><code>connection</code></em> .</p> <div class="refsect3"> <a name="GDBusMessageFilterFunction.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>A <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>message</p></td> <td class="parameter_description"><p>A locked <a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="type">GDBusMessage</span></a> that the filter function takes ownership of. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>incoming</p></td> <td class="parameter_description"><p><code class="literal">TRUE</code> if it is a message received from the other peer, <code class="literal">FALSE</code> if it is a message to be sent to the other peer.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>User data passed when adding the filter.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="GDBusMessageFilterFunction.returns"></a><h4>Returns</h4> <p>A <a class="link" href="GDBusMessage.html" title="GDBusMessage"><span class="type">GDBusMessage</span></a> that will be freed with <code class="function">g_object_unref()</code> or <code class="literal">NULL</code> to drop the message. Passive filter functions can simply return the passed <em class="parameter"><code>message</code></em> object. </p> <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-add-filter"></a><h3>g_dbus_connection_add_filter ()</h3> <pre class="programlisting"><span class="returnvalue">guint</span> g_dbus_connection_add_filter (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code><a class="link" href="GDBusConnection.html#GDBusMessageFilterFunction" title="GDBusMessageFilterFunction ()"><span class="type">GDBusMessageFilterFunction</span></a> filter_function</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>, <em class="parameter"><code><span class="type">GDestroyNotify</span> user_data_free_func</code></em>);</pre> <p>Adds a message filter. Filters are handlers that are run on all incoming and outgoing messages, prior to standard dispatch. Filters are run in the order that they were added. The same handler can be added as a filter more than once, in which case it will be run more than once. Filters added during a filter callback won't be run on the message being processed. Filter functions are allowed to modify and even drop messages.</p> <p>Note that filters are run in a dedicated message handling thread so they can't block and, generally, can't do anything but signal a worker thread. Also note that filters are rarely needed - use API such as <a class="link" href="GDBusConnection.html#g-dbus-connection-send-message-with-reply" title="g_dbus_connection_send_message_with_reply ()"><code class="function">g_dbus_connection_send_message_with_reply()</code></a>, <a class="link" href="GDBusConnection.html#g-dbus-connection-signal-subscribe" title="g_dbus_connection_signal_subscribe ()"><code class="function">g_dbus_connection_signal_subscribe()</code></a> or <a class="link" href="GDBusConnection.html#g-dbus-connection-call" title="g_dbus_connection_call ()"><code class="function">g_dbus_connection_call()</code></a> instead.</p> <p>If a filter consumes an incoming message the message is not dispatched anywhere else - not even the standard dispatch machinery (that API such as <a class="link" href="GDBusConnection.html#g-dbus-connection-signal-subscribe" title="g_dbus_connection_signal_subscribe ()"><code class="function">g_dbus_connection_signal_subscribe()</code></a> and <a class="link" href="GDBusConnection.html#g-dbus-connection-send-message-with-reply" title="g_dbus_connection_send_message_with_reply ()"><code class="function">g_dbus_connection_send_message_with_reply()</code></a> relies on) will see the message. Similarly, if a filter consumes an outgoing message, the message will not be sent to the other peer.</p> <p>If <em class="parameter"><code>user_data_free_func</code></em> is non-<code class="literal">NULL</code>, it will be called (in the thread-default main context of the thread you are calling this method from) at some point after <em class="parameter"><code>user_data</code></em> is no longer needed. (It is not guaranteed to be called synchronously when the filter is removed, and may be called after <em class="parameter"><code>connection</code></em> has been destroyed.)</p> <div class="refsect3"> <a name="g-dbus-connection-add-filter.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>filter_function</p></td> <td class="parameter_description"><p>a filter function</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>user data to pass to <em class="parameter"><code>filter_function</code></em> </p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data_free_func</p></td> <td class="parameter_description"><p>function to free <em class="parameter"><code>user_data</code></em> with when filter is removed or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-add-filter.returns"></a><h4>Returns</h4> <p> a filter identifier that can be used with <a class="link" href="GDBusConnection.html#g-dbus-connection-remove-filter" title="g_dbus_connection_remove_filter ()"><code class="function">g_dbus_connection_remove_filter()</code></a></p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-remove-filter"></a><h3>g_dbus_connection_remove_filter ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> g_dbus_connection_remove_filter (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code><span class="type">guint</span> filter_id</code></em>);</pre> <p>Removes a filter.</p> <p>Note that since filters run in a different thread, there is a race condition where it is possible that the filter will be running even after calling <a class="link" href="GDBusConnection.html#g-dbus-connection-remove-filter" title="g_dbus_connection_remove_filter ()"><code class="function">g_dbus_connection_remove_filter()</code></a>, so you cannot just free data that the filter might be using. Instead, you should pass a <span class="type">GDestroyNotify</span> to <a class="link" href="GDBusConnection.html#g-dbus-connection-add-filter" title="g_dbus_connection_add_filter ()"><code class="function">g_dbus_connection_add_filter()</code></a>, which will be called when it is guaranteed that the data is no longer needed.</p> <div class="refsect3"> <a name="g-dbus-connection-remove-filter.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>filter_id</p></td> <td class="parameter_description"><p>an identifier obtained from <a class="link" href="GDBusConnection.html#g-dbus-connection-add-filter" title="g_dbus_connection_add_filter ()"><code class="function">g_dbus_connection_add_filter()</code></a></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusInterfaceMethodCallFunc"></a><h3>GDBusInterfaceMethodCallFunc ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> <span class="c_punctuation">(</span>*GDBusInterfaceMethodCallFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *sender</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *object_path</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *interface_name</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *method_name</code></em>, <em class="parameter"><code><span class="type">GVariant</span> *parameters</code></em>, <em class="parameter"><code><a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> *invocation</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>The type of the <em class="parameter"><code>method_call</code></em> function in <a class="link" href="GDBusConnection.html#GDBusInterfaceVTable" title="GDBusInterfaceVTable"><span class="type">GDBusInterfaceVTable</span></a>.</p> <div class="refsect3"> <a name="GDBusInterfaceMethodCallFunc.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>A <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a>.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>sender</p></td> <td class="parameter_description"><p>The unique bus name of the remote caller.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>object_path</p></td> <td class="parameter_description"><p>The object path that the method was invoked on.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>interface_name</p></td> <td class="parameter_description"><p>The D-Bus interface name the method was invoked on.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>method_name</p></td> <td class="parameter_description"><p>The name of the method that was invoked.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>parameters</p></td> <td class="parameter_description"><p>A <span class="type">GVariant</span> tuple with parameters.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>invocation</p></td> <td class="parameter_description"><p>A <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> object that must be used to return a value or error. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>The <em class="parameter"><code>user_data</code></em> <span class="type">gpointer</span> passed to <a class="link" href="GDBusConnection.html#g-dbus-connection-register-object" title="g_dbus_connection_register_object ()"><code class="function">g_dbus_connection_register_object()</code></a>.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusInterfaceGetPropertyFunc"></a><h3>GDBusInterfaceGetPropertyFunc ()</h3> <pre class="programlisting"><span class="returnvalue">GVariant</span> * <span class="c_punctuation">(</span>*GDBusInterfaceGetPropertyFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *sender</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *object_path</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *interface_name</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *property_name</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>The type of the <em class="parameter"><code>get_property</code></em> function in <a class="link" href="GDBusConnection.html#GDBusInterfaceVTable" title="GDBusInterfaceVTable"><span class="type">GDBusInterfaceVTable</span></a>.</p> <div class="refsect3"> <a name="GDBusInterfaceGetPropertyFunc.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>A <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a>.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>sender</p></td> <td class="parameter_description"><p>The unique bus name of the remote caller.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>object_path</p></td> <td class="parameter_description"><p>The object path that the method was invoked on.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>interface_name</p></td> <td class="parameter_description"><p>The D-Bus interface name for the property.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>property_name</p></td> <td class="parameter_description"><p>The name of the property to get the value of.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>Return location for error.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>The <em class="parameter"><code>user_data</code></em> <span class="type">gpointer</span> passed to <a class="link" href="GDBusConnection.html#g-dbus-connection-register-object" title="g_dbus_connection_register_object ()"><code class="function">g_dbus_connection_register_object()</code></a>.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="GDBusInterfaceGetPropertyFunc.returns"></a><h4>Returns</h4> <p> A <span class="type">GVariant</span> with the value for <em class="parameter"><code>property_name</code></em> or <code class="literal">NULL</code> if <em class="parameter"><code>error</code></em> is set. If the returned <span class="type">GVariant</span> is floating, it is consumed - otherwise its reference count is decreased by one.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusInterfaceSetPropertyFunc"></a><h3>GDBusInterfaceSetPropertyFunc ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> <span class="c_punctuation">(</span>*GDBusInterfaceSetPropertyFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *sender</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *object_path</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *interface_name</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *property_name</code></em>, <em class="parameter"><code><span class="type">GVariant</span> *value</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>The type of the <em class="parameter"><code>set_property</code></em> function in <a class="link" href="GDBusConnection.html#GDBusInterfaceVTable" title="GDBusInterfaceVTable"><span class="type">GDBusInterfaceVTable</span></a>.</p> <div class="refsect3"> <a name="GDBusInterfaceSetPropertyFunc.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>A <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a>.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>sender</p></td> <td class="parameter_description"><p>The unique bus name of the remote caller.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>object_path</p></td> <td class="parameter_description"><p>The object path that the method was invoked on.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>interface_name</p></td> <td class="parameter_description"><p>The D-Bus interface name for the property.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>property_name</p></td> <td class="parameter_description"><p>The name of the property to get the value of.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>value</p></td> <td class="parameter_description"><p>The value to set the property to.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>Return location for error.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>The <em class="parameter"><code>user_data</code></em> <span class="type">gpointer</span> passed to <a class="link" href="GDBusConnection.html#g-dbus-connection-register-object" title="g_dbus_connection_register_object ()"><code class="function">g_dbus_connection_register_object()</code></a>.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="GDBusInterfaceSetPropertyFunc.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the property was set to <em class="parameter"><code>value</code></em> , <code class="literal">FALSE</code> if <em class="parameter"><code>error</code></em> is set.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-register-object"></a><h3>g_dbus_connection_register_object ()</h3> <pre class="programlisting"><span class="returnvalue">guint</span> g_dbus_connection_register_object (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *object_path</code></em>, <em class="parameter"><code><a class="link" href="gio-D-Bus-Introspection-Data.html#GDBusInterfaceInfo"><span class="type">GDBusInterfaceInfo</span></a> *interface_info</code></em>, <em class="parameter"><code>const <a class="link" href="GDBusConnection.html#GDBusInterfaceVTable" title="GDBusInterfaceVTable"><span class="type">GDBusInterfaceVTable</span></a> *vtable</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>, <em class="parameter"><code><span class="type">GDestroyNotify</span> user_data_free_func</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Registers callbacks for exported objects at <em class="parameter"><code>object_path</code></em> with the D-Bus interface that is described in <em class="parameter"><code>interface_info</code></em> .</p> <p>Calls to functions in <em class="parameter"><code>vtable</code></em> (and <em class="parameter"><code>user_data_free_func</code></em> ) will happen in the thread-default main context of the thread you are calling this method from.</p> <p>Note that all <span class="type">GVariant</span> values passed to functions in <em class="parameter"><code>vtable</code></em> will match the signature given in <em class="parameter"><code>interface_info</code></em> - if a remote caller passes incorrect values, the <code class="literal">org.freedesktop.DBus.Error.InvalidArgs</code> is returned to the remote caller.</p> <p>Additionally, if the remote caller attempts to invoke methods or access properties not mentioned in <em class="parameter"><code>interface_info</code></em> the <code class="literal">org.freedesktop.DBus.Error.UnknownMethod</code> resp. <code class="literal">org.freedesktop.DBus.Error.InvalidArgs</code> errors are returned to the caller.</p> <p>It is considered a programming error if the <a class="link" href="GDBusConnection.html#GDBusInterfaceGetPropertyFunc" title="GDBusInterfaceGetPropertyFunc ()"><span class="type">GDBusInterfaceGetPropertyFunc</span></a> function in <em class="parameter"><code>vtable</code></em> returns a <span class="type">GVariant</span> of incorrect type.</p> <p>If an existing callback is already registered at <em class="parameter"><code>object_path</code></em> and <em class="parameter"><code>interface_name</code></em> , then <em class="parameter"><code>error</code></em> is set to <a class="link" href="gio-GIOError.html#G-IO-ERROR-EXISTS:CAPS"><span class="type">G_IO_ERROR_EXISTS</span></a>.</p> <p>GDBus automatically implements the standard D-Bus interfaces org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable and org.freedesktop.Peer, so you don't have to implement those for the objects you export. You can implement org.freedesktop.DBus.Properties yourself, e.g. to handle getting and setting of properties asynchronously.</p> <p>Note that the reference count on <em class="parameter"><code>interface_info</code></em> will be incremented by 1 (unless allocated statically, e.g. if the reference count is -1, see <a class="link" href="gio-D-Bus-Introspection-Data.html#g-dbus-interface-info-ref" title="g_dbus_interface_info_ref ()"><code class="function">g_dbus_interface_info_ref()</code></a>) for as long as the object is exported. Also note that <em class="parameter"><code>vtable</code></em> will be copied.</p> <p>See this <a class="link" href="GDBusConnection.html#gdbus-server" title="An example D-Bus server">server</a> for an example of how to use this method.</p> <div class="refsect3"> <a name="g-dbus-connection-register-object.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>object_path</p></td> <td class="parameter_description"><p>the object path to register at</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>interface_info</p></td> <td class="parameter_description"><p>introspection data for the interface</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>vtable</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html#GDBusInterfaceVTable" title="GDBusInterfaceVTable"><span class="type">GDBusInterfaceVTable</span></a> to call into or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>data to pass to functions in <em class="parameter"><code>vtable</code></em> . </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data_free_func</p></td> <td class="parameter_description"><p>function to call when the object path is unregistered</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-register-object.returns"></a><h4>Returns</h4> <p> 0 if <em class="parameter"><code>error</code></em> is set, otherwise a registration id (never 0) that can be used with <a class="link" href="GDBusConnection.html#g-dbus-connection-unregister-object" title="g_dbus_connection_unregister_object ()"><code class="function">g_dbus_connection_unregister_object()</code></a></p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-unregister-object"></a><h3>g_dbus_connection_unregister_object ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_dbus_connection_unregister_object (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code><span class="type">guint</span> registration_id</code></em>);</pre> <p>Unregisters an object.</p> <div class="refsect3"> <a name="g-dbus-connection-unregister-object.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>registration_id</p></td> <td class="parameter_description"><p>a registration id obtained from <a class="link" href="GDBusConnection.html#g-dbus-connection-register-object" title="g_dbus_connection_register_object ()"><code class="function">g_dbus_connection_register_object()</code></a></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-unregister-object.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the object was unregistered, <code class="literal">FALSE</code> otherwise</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-register-object-with-closures"></a><h3>g_dbus_connection_register_object_with_closures ()</h3> <pre class="programlisting"><span class="returnvalue">guint</span> g_dbus_connection_register_object_with_closures (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *object_path</code></em>, <em class="parameter"><code><a class="link" href="gio-D-Bus-Introspection-Data.html#GDBusInterfaceInfo"><span class="type">GDBusInterfaceInfo</span></a> *interface_info</code></em>, <em class="parameter"><code><span class="type">GClosure</span> *method_call_closure</code></em>, <em class="parameter"><code><span class="type">GClosure</span> *get_property_closure</code></em>, <em class="parameter"><code><span class="type">GClosure</span> *set_property_closure</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Version of <a class="link" href="GDBusConnection.html#g-dbus-connection-register-object" title="g_dbus_connection_register_object ()"><code class="function">g_dbus_connection_register_object()</code></a> using closures instead of a <a class="link" href="GDBusConnection.html#GDBusInterfaceVTable" title="GDBusInterfaceVTable"><span class="type">GDBusInterfaceVTable</span></a> for easier binding in other languages.</p> <p><span class="annotation">[<acronym title="Rename the original symbol's name to SYMBOL."><span class="acronym">rename-to</span></acronym> g_dbus_connection_register_object]</span></p> <div class="refsect3"> <a name="g-dbus-connection-register-object-with-closures.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>A <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a>.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>object_path</p></td> <td class="parameter_description"><p>The object path to register at.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>interface_info</p></td> <td class="parameter_description"><p>Introspection data for the interface.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>method_call_closure</p></td> <td class="parameter_description"><p><span class="type">GClosure</span> for handling incoming method calls. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>get_property_closure</p></td> <td class="parameter_description"><p><span class="type">GClosure</span> for getting a property. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>set_property_closure</p></td> <td class="parameter_description"><p><span class="type">GClosure</span> for setting a property. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>Return location for error or <code class="literal">NULL</code>.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-register-object-with-closures.returns"></a><h4>Returns</h4> <p> 0 if <em class="parameter"><code>error</code></em> is set, otherwise a registration id (never 0) that can be used with <a class="link" href="GDBusConnection.html#g-dbus-connection-unregister-object" title="g_dbus_connection_unregister_object ()"><code class="function">g_dbus_connection_unregister_object()</code></a> .</p> </div> <p class="since">Since: <a class="link" href="api-index-2-46.html#api-index-2.46">2.46</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusSubtreeEnumerateFunc"></a><h3>GDBusSubtreeEnumerateFunc ()</h3> <pre class="programlisting"><span class="returnvalue">gchar</span> ** <span class="c_punctuation">(</span>*GDBusSubtreeEnumerateFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *sender</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *object_path</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>The type of the <em class="parameter"><code>enumerate</code></em> function in <a class="link" href="GDBusConnection.html#GDBusSubtreeVTable" title="GDBusSubtreeVTable"><span class="type">GDBusSubtreeVTable</span></a>.</p> <p>This function is called when generating introspection data and also when preparing to dispatch incoming messages in the event that the <a class="link" href="GDBusConnection.html#G-DBUS-SUBTREE-FLAGS-DISPATCH-TO-UNENUMERATED-NODES:CAPS"><code class="literal">G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES</code></a> flag is not specified (ie: to verify that the object path is valid).</p> <p>Hierarchies are not supported; the items that you return should not contain the '/' character.</p> <p>The return value will be freed with <code class="function">g_strfreev()</code>.</p> <div class="refsect3"> <a name="GDBusSubtreeEnumerateFunc.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>A <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a>.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>sender</p></td> <td class="parameter_description"><p>The unique bus name of the remote caller.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>object_path</p></td> <td class="parameter_description"><p>The object path that was registered with <a class="link" href="GDBusConnection.html#g-dbus-connection-register-subtree" title="g_dbus_connection_register_subtree ()"><code class="function">g_dbus_connection_register_subtree()</code></a>.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>The <em class="parameter"><code>user_data</code></em> <span class="type">gpointer</span> passed to <a class="link" href="GDBusConnection.html#g-dbus-connection-register-subtree" title="g_dbus_connection_register_subtree ()"><code class="function">g_dbus_connection_register_subtree()</code></a>.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="GDBusSubtreeEnumerateFunc.returns"></a><h4>Returns</h4> <p> A newly allocated array of strings for node names that are children of <em class="parameter"><code>object_path</code></em> .</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusSubtreeIntrospectFunc"></a><h3>GDBusSubtreeIntrospectFunc ()</h3> <pre class="programlisting"><a class="link" href="gio-D-Bus-Introspection-Data.html#GDBusInterfaceInfo"><span class="returnvalue">GDBusInterfaceInfo</span></a> ** <span class="c_punctuation">(</span>*GDBusSubtreeIntrospectFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *sender</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *object_path</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *node</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>The type of the <em class="parameter"><code>introspect</code></em> function in <a class="link" href="GDBusConnection.html#GDBusSubtreeVTable" title="GDBusSubtreeVTable"><span class="type">GDBusSubtreeVTable</span></a>.</p> <p>Subtrees are flat. <em class="parameter"><code>node</code></em> , if non-<code class="literal">NULL</code>, is always exactly one segment of the object path (ie: it never contains a slash).</p> <p>This function should return <code class="literal">NULL</code> to indicate that there is no object at this node.</p> <p>If this function returns non-<code class="literal">NULL</code>, the return value is expected to be a <code class="literal">NULL</code>-terminated array of pointers to <a class="link" href="gio-D-Bus-Introspection-Data.html#GDBusInterfaceInfo"><span class="type">GDBusInterfaceInfo</span></a> structures describing the interfaces implemented by <em class="parameter"><code>node</code></em> . This array will have <a class="link" href="gio-D-Bus-Introspection-Data.html#g-dbus-interface-info-unref" title="g_dbus_interface_info_unref ()"><code class="function">g_dbus_interface_info_unref()</code></a> called on each item before being freed with <code class="function">g_free()</code>.</p> <p>The difference between returning <code class="literal">NULL</code> and an array containing zero items is that the standard DBus interfaces will returned to the remote introspector in the empty array case, but not in the <code class="literal">NULL</code> case.</p> <div class="refsect3"> <a name="GDBusSubtreeIntrospectFunc.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>A <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a>.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>sender</p></td> <td class="parameter_description"><p>The unique bus name of the remote caller.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>object_path</p></td> <td class="parameter_description"><p>The object path that was registered with <a class="link" href="GDBusConnection.html#g-dbus-connection-register-subtree" title="g_dbus_connection_register_subtree ()"><code class="function">g_dbus_connection_register_subtree()</code></a>.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>A node that is a child of <em class="parameter"><code>object_path</code></em> (relative to <em class="parameter"><code>object_path</code></em> ) or <code class="literal">NULL</code> for the root of the subtree.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>The <em class="parameter"><code>user_data</code></em> <span class="type">gpointer</span> passed to <a class="link" href="GDBusConnection.html#g-dbus-connection-register-subtree" title="g_dbus_connection_register_subtree ()"><code class="function">g_dbus_connection_register_subtree()</code></a>.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="GDBusSubtreeIntrospectFunc.returns"></a><h4>Returns</h4> <p> A <code class="literal">NULL</code>-terminated array of pointers to <a class="link" href="gio-D-Bus-Introspection-Data.html#GDBusInterfaceInfo"><span class="type">GDBusInterfaceInfo</span></a>, or <code class="literal">NULL</code>.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusSubtreeDispatchFunc"></a><h3>GDBusSubtreeDispatchFunc ()</h3> <pre class="programlisting">const <a class="link" href="GDBusConnection.html#GDBusInterfaceVTable" title="GDBusInterfaceVTable"><span class="returnvalue">GDBusInterfaceVTable</span></a> * <span class="c_punctuation">(</span>*GDBusSubtreeDispatchFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *sender</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *object_path</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *interface_name</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *node</code></em>, <em class="parameter"><code><span class="type">gpointer</span> *out_user_data</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre> <p>The type of the <em class="parameter"><code>dispatch</code></em> function in <a class="link" href="GDBusConnection.html#GDBusSubtreeVTable" title="GDBusSubtreeVTable"><span class="type">GDBusSubtreeVTable</span></a>.</p> <p>Subtrees are flat. <em class="parameter"><code>node</code></em> , if non-<code class="literal">NULL</code>, is always exactly one segment of the object path (ie: it never contains a slash).</p> <div class="refsect3"> <a name="GDBusSubtreeDispatchFunc.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>A <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a>.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>sender</p></td> <td class="parameter_description"><p>The unique bus name of the remote caller.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>object_path</p></td> <td class="parameter_description"><p>The object path that was registered with <a class="link" href="GDBusConnection.html#g-dbus-connection-register-subtree" title="g_dbus_connection_register_subtree ()"><code class="function">g_dbus_connection_register_subtree()</code></a>.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>interface_name</p></td> <td class="parameter_description"><p>The D-Bus interface name that the method call or property access is for.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>node</p></td> <td class="parameter_description"><p>A node that is a child of <em class="parameter"><code>object_path</code></em> (relative to <em class="parameter"><code>object_path</code></em> ) or <code class="literal">NULL</code> for the root of the subtree.</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>out_user_data</p></td> <td class="parameter_description"><p>Return location for user data to pass to functions in the returned <a class="link" href="GDBusConnection.html#GDBusInterfaceVTable" title="GDBusInterfaceVTable"><span class="type">GDBusInterfaceVTable</span></a>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="NULL must not be passed as the pointer to a location."><span class="acronym">not optional</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>The <em class="parameter"><code>user_data</code></em> <span class="type">gpointer</span> passed to <a class="link" href="GDBusConnection.html#g-dbus-connection-register-subtree" title="g_dbus_connection_register_subtree ()"><code class="function">g_dbus_connection_register_subtree()</code></a>.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="GDBusSubtreeDispatchFunc.returns"></a><h4>Returns</h4> <p> A <a class="link" href="GDBusConnection.html#GDBusInterfaceVTable" title="GDBusInterfaceVTable"><span class="type">GDBusInterfaceVTable</span></a> or <code class="literal">NULL</code> if you don't want to handle the methods.</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-register-subtree"></a><h3>g_dbus_connection_register_subtree ()</h3> <pre class="programlisting"><span class="returnvalue">guint</span> g_dbus_connection_register_subtree (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code>const <span class="type">gchar</span> *object_path</code></em>, <em class="parameter"><code>const <a class="link" href="GDBusConnection.html#GDBusSubtreeVTable" title="GDBusSubtreeVTable"><span class="type">GDBusSubtreeVTable</span></a> *vtable</code></em>, <em class="parameter"><code><a class="link" href="GDBusConnection.html#GDBusSubtreeFlags" title="enum GDBusSubtreeFlags"><span class="type">GDBusSubtreeFlags</span></a> flags</code></em>, <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>, <em class="parameter"><code><span class="type">GDestroyNotify</span> user_data_free_func</code></em>, <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre> <p>Registers a whole subtree of dynamic objects.</p> <p>The <em class="parameter"><code>enumerate</code></em> and <em class="parameter"><code>introspection</code></em> functions in <em class="parameter"><code>vtable</code></em> are used to convey, to remote callers, what nodes exist in the subtree rooted by <em class="parameter"><code>object_path</code></em> .</p> <p>When handling remote calls into any node in the subtree, first the <em class="parameter"><code>enumerate</code></em> function is used to check if the node exists. If the node exists or the <a class="link" href="GDBusConnection.html#G-DBUS-SUBTREE-FLAGS-DISPATCH-TO-UNENUMERATED-NODES:CAPS"><span class="type">G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES</span></a> flag is set the <em class="parameter"><code>introspection</code></em> function is used to check if the node supports the requested method. If so, the <em class="parameter"><code>dispatch</code></em> function is used to determine where to dispatch the call. The collected <a class="link" href="GDBusConnection.html#GDBusInterfaceVTable" title="GDBusInterfaceVTable"><span class="type">GDBusInterfaceVTable</span></a> and <span class="type">gpointer</span> will be used to call into the interface vtable for processing the request.</p> <p>All calls into user-provided code will be invoked in the thread-default main context of the thread you are calling this method from.</p> <p>If an existing subtree is already registered at <em class="parameter"><code>object_path</code></em> or then <em class="parameter"><code>error</code></em> is set to <a class="link" href="gio-GIOError.html#G-IO-ERROR-EXISTS:CAPS"><span class="type">G_IO_ERROR_EXISTS</span></a>.</p> <p>Note that it is valid to register regular objects (using <a class="link" href="GDBusConnection.html#g-dbus-connection-register-object" title="g_dbus_connection_register_object ()"><code class="function">g_dbus_connection_register_object()</code></a>) in a subtree registered with <a class="link" href="GDBusConnection.html#g-dbus-connection-register-subtree" title="g_dbus_connection_register_subtree ()"><code class="function">g_dbus_connection_register_subtree()</code></a> - if so, the subtree handler is tried as the last resort. One way to think about a subtree handler is to consider it a fallback handler for object paths not registered via <a class="link" href="GDBusConnection.html#g-dbus-connection-register-object" title="g_dbus_connection_register_object ()"><code class="function">g_dbus_connection_register_object()</code></a> or other bindings.</p> <p>Note that <em class="parameter"><code>vtable</code></em> will be copied so you cannot change it after registration.</p> <p>See this <a class="link" href="GDBusConnection.html#gdbus-subtree-server" title="An example for exporting a subtree">server</a> for an example of how to use this method.</p> <div class="refsect3"> <a name="g-dbus-connection-register-subtree.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>object_path</p></td> <td class="parameter_description"><p>the object path to register the subtree at</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>vtable</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html#GDBusSubtreeVTable" title="GDBusSubtreeVTable"><span class="type">GDBusSubtreeVTable</span></a> to enumerate, introspect and dispatch nodes in the subtree</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>flags</p></td> <td class="parameter_description"><p>flags used to fine tune the behavior of the subtree</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>data to pass to functions in <em class="parameter"><code>vtable</code></em> </p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>user_data_free_func</p></td> <td class="parameter_description"><p>function to call when the subtree is unregistered</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>return location for error or <code class="literal">NULL</code></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-register-subtree.returns"></a><h4>Returns</h4> <p> 0 if <em class="parameter"><code>error</code></em> is set, otherwise a subtree registration id (never 0) that can be used with <a class="link" href="GDBusConnection.html#g-dbus-connection-unregister-subtree" title="g_dbus_connection_unregister_subtree ()"><code class="function">g_dbus_connection_unregister_subtree()</code></a> .</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="g-dbus-connection-unregister-subtree"></a><h3>g_dbus_connection_unregister_subtree ()</h3> <pre class="programlisting"><span class="returnvalue">gboolean</span> g_dbus_connection_unregister_subtree (<em class="parameter"><code><a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection</code></em>, <em class="parameter"><code><span class="type">guint</span> registration_id</code></em>);</pre> <p>Unregisters a subtree.</p> <div class="refsect3"> <a name="g-dbus-connection-unregister-subtree.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a></p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>registration_id</p></td> <td class="parameter_description"><p>a subtree registration id obtained from <a class="link" href="GDBusConnection.html#g-dbus-connection-register-subtree" title="g_dbus_connection_register_subtree ()"><code class="function">g_dbus_connection_register_subtree()</code></a></p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <div class="refsect3"> <a name="g-dbus-connection-unregister-subtree.returns"></a><h4>Returns</h4> <p> <code class="literal">TRUE</code> if the subtree was unregistered, <code class="literal">FALSE</code> otherwise</p> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> </div> <div class="refsect1"> <a name="GDBusConnection.other_details"></a><h2>Types and Values</h2> <div class="refsect2"> <a name="GBusType"></a><h3>enum GBusType</h3> <p>An enumeration for well-known message buses.</p> <div class="refsect3"> <a name="GBusType.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="enum_members_name"> <col class="enum_members_description"> <col width="200px" class="enum_members_annotations"> </colgroup> <tbody> <tr> <td class="enum_member_name"><p><a name="G-BUS-TYPE-STARTER:CAPS"></a>G_BUS_TYPE_STARTER</p></td> <td class="enum_member_description"> <p>An alias for the message bus that activated the process, if any.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-BUS-TYPE-NONE:CAPS"></a>G_BUS_TYPE_NONE</p></td> <td class="enum_member_description"> <p>Not a message bus.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-BUS-TYPE-SYSTEM:CAPS"></a>G_BUS_TYPE_SYSTEM</p></td> <td class="enum_member_description"> <p>The system-wide message bus.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-BUS-TYPE-SESSION:CAPS"></a>G_BUS_TYPE_SESSION</p></td> <td class="enum_member_description"> <p>The login session message bus.</p> </td> <td class="enum_member_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusConnection-struct"></a><h3>GDBusConnection</h3> <pre class="programlisting">typedef struct _GDBusConnection GDBusConnection;</pre> <p>The <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> structure contains only private data and should only be accessed using the provided API.</p> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusConnectionFlags"></a><h3>enum GDBusConnectionFlags</h3> <p>Flags used when creating a new <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a>.</p> <div class="refsect3"> <a name="GDBusConnectionFlags.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="enum_members_name"> <col class="enum_members_description"> <col width="200px" class="enum_members_annotations"> </colgroup> <tbody> <tr> <td class="enum_member_name"><p><a name="G-DBUS-CONNECTION-FLAGS-NONE:CAPS"></a>G_DBUS_CONNECTION_FLAGS_NONE</p></td> <td class="enum_member_description"> <p>No flags set.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-DBUS-CONNECTION-FLAGS-AUTHENTICATION-CLIENT:CAPS"></a>G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT</p></td> <td class="enum_member_description"> <p>Perform authentication against server.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-DBUS-CONNECTION-FLAGS-AUTHENTICATION-SERVER:CAPS"></a>G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER</p></td> <td class="enum_member_description"> <p>Perform authentication against client.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-DBUS-CONNECTION-FLAGS-AUTHENTICATION-ALLOW-ANONYMOUS:CAPS"></a>G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS</p></td> <td class="enum_member_description"> <p>When authenticating as a server, allow the anonymous authentication method.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-DBUS-CONNECTION-FLAGS-MESSAGE-BUS-CONNECTION:CAPS"></a>G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION</p></td> <td class="enum_member_description"> <p>Pass this flag if connecting to a peer that is a message bus. This means that the <code class="function">Hello()</code> method will be invoked as part of the connection setup.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-DBUS-CONNECTION-FLAGS-DELAY-MESSAGE-PROCESSING:CAPS"></a>G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING</p></td> <td class="enum_member_description"> <p>If set, processing of D-Bus messages is delayed until <a class="link" href="GDBusConnection.html#g-dbus-connection-start-message-processing" title="g_dbus_connection_start_message_processing ()"><code class="function">g_dbus_connection_start_message_processing()</code></a> is called.</p> </td> <td class="enum_member_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusCapabilityFlags"></a><h3>enum GDBusCapabilityFlags</h3> <p>Capabilities negotiated with the remote peer.</p> <div class="refsect3"> <a name="GDBusCapabilityFlags.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="enum_members_name"> <col class="enum_members_description"> <col width="200px" class="enum_members_annotations"> </colgroup> <tbody> <tr> <td class="enum_member_name"><p><a name="G-DBUS-CAPABILITY-FLAGS-NONE:CAPS"></a>G_DBUS_CAPABILITY_FLAGS_NONE</p></td> <td class="enum_member_description"> <p>No flags set.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-DBUS-CAPABILITY-FLAGS-UNIX-FD-PASSING:CAPS"></a>G_DBUS_CAPABILITY_FLAGS_UNIX_FD_PASSING</p></td> <td class="enum_member_description"> <p>The connection supports exchanging UNIX file descriptors with the remote peer.</p> </td> <td class="enum_member_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusCallFlags"></a><h3>enum GDBusCallFlags</h3> <p>Flags used in <a class="link" href="GDBusConnection.html#g-dbus-connection-call" title="g_dbus_connection_call ()"><code class="function">g_dbus_connection_call()</code></a> and similar APIs.</p> <div class="refsect3"> <a name="GDBusCallFlags.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="enum_members_name"> <col class="enum_members_description"> <col width="200px" class="enum_members_annotations"> </colgroup> <tbody> <tr> <td class="enum_member_name"><p><a name="G-DBUS-CALL-FLAGS-NONE:CAPS"></a>G_DBUS_CALL_FLAGS_NONE</p></td> <td class="enum_member_description"> <p>No flags set.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-DBUS-CALL-FLAGS-NO-AUTO-START:CAPS"></a>G_DBUS_CALL_FLAGS_NO_AUTO_START</p></td> <td class="enum_member_description"> <p>The bus must not launch an owner for the destination name in response to this method invocation.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-DBUS-CALL-FLAGS-ALLOW-INTERACTIVE-AUTHORIZATION:CAPS"></a>G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION</p></td> <td class="enum_member_description"> <p>the caller is prepared to wait for interactive authorization. Since 2.46.</p> </td> <td class="enum_member_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusSignalFlags"></a><h3>enum GDBusSignalFlags</h3> <p>Flags used when subscribing to signals via <a class="link" href="GDBusConnection.html#g-dbus-connection-signal-subscribe" title="g_dbus_connection_signal_subscribe ()"><code class="function">g_dbus_connection_signal_subscribe()</code></a>.</p> <div class="refsect3"> <a name="GDBusSignalFlags.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="enum_members_name"> <col class="enum_members_description"> <col width="200px" class="enum_members_annotations"> </colgroup> <tbody> <tr> <td class="enum_member_name"><p><a name="G-DBUS-SIGNAL-FLAGS-NONE:CAPS"></a>G_DBUS_SIGNAL_FLAGS_NONE</p></td> <td class="enum_member_description"> <p>No flags set.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-DBUS-SIGNAL-FLAGS-NO-MATCH-RULE:CAPS"></a>G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE</p></td> <td class="enum_member_description"> <p>Don't actually send the AddMatch D-Bus call for this signal subscription. This gives you more control over which match rules you add (but you must add them manually).</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-DBUS-SIGNAL-FLAGS-MATCH-ARG0-NAMESPACE:CAPS"></a>G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_NAMESPACE</p></td> <td class="enum_member_description"> <p>Match first arguments that contain a bus or interface name with the given namespace.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-DBUS-SIGNAL-FLAGS-MATCH-ARG0-PATH:CAPS"></a>G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH</p></td> <td class="enum_member_description"> <p>Match first arguments that contain an object path that is either equivalent to the given path, or one of the paths is a subpath of the other.</p> </td> <td class="enum_member_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusSendMessageFlags"></a><h3>enum GDBusSendMessageFlags</h3> <p>Flags used when sending <span class="type">GDBusMessages</span> on a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a>.</p> <div class="refsect3"> <a name="GDBusSendMessageFlags.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="enum_members_name"> <col class="enum_members_description"> <col width="200px" class="enum_members_annotations"> </colgroup> <tbody> <tr> <td class="enum_member_name"><p><a name="G-DBUS-SEND-MESSAGE-FLAGS-NONE:CAPS"></a>G_DBUS_SEND_MESSAGE_FLAGS_NONE</p></td> <td class="enum_member_description"> <p>No flags set.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-DBUS-SEND-MESSAGE-FLAGS-PRESERVE-SERIAL:CAPS"></a>G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL</p></td> <td class="enum_member_description"> <p>Do not automatically assign a serial number from the <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> object when sending a message.</p> </td> <td class="enum_member_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusInterfaceVTable"></a><h3>GDBusInterfaceVTable</h3> <pre class="programlisting">typedef struct { GDBusInterfaceMethodCallFunc method_call; GDBusInterfaceGetPropertyFunc get_property; GDBusInterfaceSetPropertyFunc set_property; } GDBusInterfaceVTable; </pre> <p>Virtual table for handling properties and method calls for a D-Bus interface.</p> <p>Since 2.38, if you want to handle getting/setting D-Bus properties asynchronously, give <code class="literal">NULL</code> as your <code class="function">get_property()</code> or <code class="function">set_property()</code> function. The D-Bus call will be directed to your <em class="parameter"><code>method_call</code></em> function, with the provided <em class="parameter"><code>interface_name</code></em> set to "org.freedesktop.DBus.Properties".</p> <p>Ownership of the <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> object passed to the <code class="function">method_call()</code> function is transferred to your handler; you must call one of the methods of <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> to return a reply (possibly empty), or an error. These functions also take ownership of the passed-in invocation object, so unless the invocation object has otherwise been referenced, it will be then be freed. Calling one of these functions may be done within your <code class="function">method_call()</code> implementation but it also can be done at a later point to handle the method asynchronously.</p> <p>The usual checks on the validity of the calls is performed. For <code class="literal">Get</code> calls, an error is automatically returned if the property does not exist or the permissions do not allow access. The same checks are performed for <code class="literal">Set</code> calls, and the provided value is also checked for being the correct type.</p> <p>For both <code class="literal">Get</code> and <code class="literal">Set</code> calls, the <a class="link" href="GDBusMethodInvocation.html" title="GDBusMethodInvocation"><span class="type">GDBusMethodInvocation</span></a> passed to the <em class="parameter"><code>method_call</code></em> handler can be queried with <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-get-property-info" title="g_dbus_method_invocation_get_property_info ()"><code class="function">g_dbus_method_invocation_get_property_info()</code></a> to get a pointer to the <a class="link" href="gio-D-Bus-Introspection-Data.html#GDBusPropertyInfo"><span class="type">GDBusPropertyInfo</span></a> of the property.</p> <p>If you have readable properties specified in your interface info, you must ensure that you either provide a non-<code class="literal">NULL</code> <em class="parameter"><code><code class="function">get_property()</code></code></em> function or provide implementations of both the <code class="literal">Get</code> and <code class="literal">GetAll</code> methods on org.freedesktop.DBus.Properties interface in your <em class="parameter"><code>method_call</code></em> function. Note that the required return type of the <code class="literal">Get</code> call is <code class="literal">(v)</code>, not the type of the property. <code class="literal">GetAll</code> expects a return value of type <code class="literal">a{sv}</code>.</p> <p>If you have writable properties specified in your interface info, you must ensure that you either provide a non-<code class="literal">NULL</code> <em class="parameter"><code><code class="function">set_property()</code></code></em> function or provide an implementation of the <code class="literal">Set</code> call. If implementing the call, you must return the value of type <code class="literal">G_VARIANT_TYPE_UNIT</code>.</p> <div class="refsect3"> <a name="GDBusInterfaceVTable.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="struct_members_name"> <col class="struct_members_description"> <col width="200px" class="struct_members_annotations"> </colgroup> <tbody> <tr> <td class="struct_member_name"><p><a class="link" href="GDBusConnection.html#GDBusInterfaceMethodCallFunc" title="GDBusInterfaceMethodCallFunc ()"><span class="type">GDBusInterfaceMethodCallFunc</span></a> <em class="structfield"><code><a name="GDBusInterfaceVTable.method-call"></a>method_call</code></em>;</p></td> <td class="struct_member_description"><p>Function for handling incoming method calls.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><a class="link" href="GDBusConnection.html#GDBusInterfaceGetPropertyFunc" title="GDBusInterfaceGetPropertyFunc ()"><span class="type">GDBusInterfaceGetPropertyFunc</span></a> <em class="structfield"><code><a name="GDBusInterfaceVTable.get-property"></a>get_property</code></em>;</p></td> <td class="struct_member_description"><p>Function for getting a property.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><a class="link" href="GDBusConnection.html#GDBusInterfaceSetPropertyFunc" title="GDBusInterfaceSetPropertyFunc ()"><span class="type">GDBusInterfaceSetPropertyFunc</span></a> <em class="structfield"><code><a name="GDBusInterfaceVTable.set-property"></a>set_property</code></em>;</p></td> <td class="struct_member_description"><p>Function for setting a property.</p></td> <td class="struct_member_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusSubtreeVTable"></a><h3>GDBusSubtreeVTable</h3> <pre class="programlisting">typedef struct { GDBusSubtreeEnumerateFunc enumerate; GDBusSubtreeIntrospectFunc introspect; GDBusSubtreeDispatchFunc dispatch; } GDBusSubtreeVTable; </pre> <p>Virtual table for handling subtrees registered with <a class="link" href="GDBusConnection.html#g-dbus-connection-register-subtree" title="g_dbus_connection_register_subtree ()"><code class="function">g_dbus_connection_register_subtree()</code></a>.</p> <div class="refsect3"> <a name="GDBusSubtreeVTable.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="struct_members_name"> <col class="struct_members_description"> <col width="200px" class="struct_members_annotations"> </colgroup> <tbody> <tr> <td class="struct_member_name"><p><a class="link" href="GDBusConnection.html#GDBusSubtreeEnumerateFunc" title="GDBusSubtreeEnumerateFunc ()"><span class="type">GDBusSubtreeEnumerateFunc</span></a> <em class="structfield"><code><a name="GDBusSubtreeVTable.enumerate"></a>enumerate</code></em>;</p></td> <td class="struct_member_description"><p>Function for enumerating child nodes.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><a class="link" href="GDBusConnection.html#GDBusSubtreeIntrospectFunc" title="GDBusSubtreeIntrospectFunc ()"><span class="type">GDBusSubtreeIntrospectFunc</span></a> <em class="structfield"><code><a name="GDBusSubtreeVTable.introspect"></a>introspect</code></em>;</p></td> <td class="struct_member_description"><p>Function for introspecting a child node.</p></td> <td class="struct_member_annotations"> </td> </tr> <tr> <td class="struct_member_name"><p><a class="link" href="GDBusConnection.html#GDBusSubtreeDispatchFunc" title="GDBusSubtreeDispatchFunc ()"><span class="type">GDBusSubtreeDispatchFunc</span></a> <em class="structfield"><code><a name="GDBusSubtreeVTable.dispatch"></a>dispatch</code></em>;</p></td> <td class="struct_member_description"><p>Function for dispatching a remote call on a child node.</p></td> <td class="struct_member_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusSubtreeFlags"></a><h3>enum GDBusSubtreeFlags</h3> <p>Flags passed to <a class="link" href="GDBusConnection.html#g-dbus-connection-register-subtree" title="g_dbus_connection_register_subtree ()"><code class="function">g_dbus_connection_register_subtree()</code></a>.</p> <div class="refsect3"> <a name="GDBusSubtreeFlags.members"></a><h4>Members</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="300px" class="enum_members_name"> <col class="enum_members_description"> <col width="200px" class="enum_members_annotations"> </colgroup> <tbody> <tr> <td class="enum_member_name"><p><a name="G-DBUS-SUBTREE-FLAGS-NONE:CAPS"></a>G_DBUS_SUBTREE_FLAGS_NONE</p></td> <td class="enum_member_description"> <p>No flags set.</p> </td> <td class="enum_member_annotations"> </td> </tr> <tr> <td class="enum_member_name"><p><a name="G-DBUS-SUBTREE-FLAGS-DISPATCH-TO-UNENUMERATED-NODES:CAPS"></a>G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES</p></td> <td class="enum_member_description"> <p>Method calls to objects not in the enumerated range will still be dispatched. This is useful if you want to dynamically spawn objects in the subtree.</p> </td> <td class="enum_member_annotations"> </td> </tr> </tbody> </table></div> </div> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> </div> <div class="refsect1"> <a name="GDBusConnection.property-details"></a><h2>Property Details</h2> <div class="refsect2"> <a name="GDBusConnection--address"></a><h3>The <code class="literal">“address”</code> property</h3> <pre class="programlisting"> “address” <span class="type">gchar</span> *</pre> <p>A D-Bus address specifying potential endpoints that can be used when establishing the connection.</p> <p>Owner: GDBusConnection</p> <p>Flags: Write / Construct Only</p> <p>Default value: NULL</p> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusConnection--authentication-observer"></a><h3>The <code class="literal">“authentication-observer”</code> property</h3> <pre class="programlisting"> “authentication-observer” <a class="link" href="GDBusAuthObserver.html" title="GDBusAuthObserver"><span class="type">GDBusAuthObserver</span></a> *</pre> <p>A <a class="link" href="GDBusAuthObserver.html" title="GDBusAuthObserver"><span class="type">GDBusAuthObserver</span></a> object to assist in the authentication process or <code class="literal">NULL</code>.</p> <p>Owner: GDBusConnection</p> <p>Flags: Write / Construct Only</p> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusConnection--capabilities"></a><h3>The <code class="literal">“capabilities”</code> property</h3> <pre class="programlisting"> “capabilities” <a class="link" href="GDBusConnection.html#GDBusCapabilityFlags" title="enum GDBusCapabilityFlags"><span class="type">GDBusCapabilityFlags</span></a></pre> <p>Flags from the <a class="link" href="GDBusConnection.html#GDBusCapabilityFlags" title="enum GDBusCapabilityFlags"><span class="type">GDBusCapabilityFlags</span></a> enumeration representing connection features negotiated with the other peer.</p> <p>Owner: GDBusConnection</p> <p>Flags: Read</p> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusConnection--closed"></a><h3>The <code class="literal">“closed”</code> property</h3> <pre class="programlisting"> “closed” <span class="type">gboolean</span></pre> <p>A boolean specifying whether the connection has been closed.</p> <p>Owner: GDBusConnection</p> <p>Flags: Read</p> <p>Default value: FALSE</p> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusConnection--exit-on-close"></a><h3>The <code class="literal">“exit-on-close”</code> property</h3> <pre class="programlisting"> “exit-on-close” <span class="type">gboolean</span></pre> <p>A boolean specifying whether the process will be terminated (by calling <code class="literal">raise(SIGTERM)</code>) if the connection is closed by the remote peer.</p> <p>Note that <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> objects returned by <a class="link" href="GDBusConnection.html#g-bus-get-finish" title="g_bus_get_finish ()"><code class="function">g_bus_get_finish()</code></a> and <a class="link" href="GDBusConnection.html#g-bus-get-sync" title="g_bus_get_sync ()"><code class="function">g_bus_get_sync()</code></a> will (usually) have this property set to <code class="literal">TRUE</code>.</p> <p>Owner: GDBusConnection</p> <p>Flags: Read / Write</p> <p>Default value: FALSE</p> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusConnection--flags"></a><h3>The <code class="literal">“flags”</code> property</h3> <pre class="programlisting"> “flags” <a class="link" href="GDBusConnection.html#GDBusConnectionFlags" title="enum GDBusConnectionFlags"><span class="type">GDBusConnectionFlags</span></a></pre> <p>Flags from the <a class="link" href="GDBusConnection.html#GDBusConnectionFlags" title="enum GDBusConnectionFlags"><span class="type">GDBusConnectionFlags</span></a> enumeration.</p> <p>Owner: GDBusConnection</p> <p>Flags: Read / Write / Construct Only</p> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusConnection--guid"></a><h3>The <code class="literal">“guid”</code> property</h3> <pre class="programlisting"> “guid” <span class="type">gchar</span> *</pre> <p>The GUID of the peer performing the role of server when authenticating.</p> <p>If you are constructing a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> and pass <a class="link" href="GDBusConnection.html#G-DBUS-CONNECTION-FLAGS-AUTHENTICATION-SERVER:CAPS"><code class="literal">G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER</code></a> in the <a class="link" href="GDBusConnection.html#GDBusConnection--flags" title="The “flags” property"><span class="type">“flags”</span></a> property then you MUST also set this property to a valid guid.</p> <p>If you are constructing a <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> and pass <a class="link" href="GDBusConnection.html#G-DBUS-CONNECTION-FLAGS-AUTHENTICATION-CLIENT:CAPS"><code class="literal">G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT</code></a> in the <a class="link" href="GDBusConnection.html#GDBusConnection--flags" title="The “flags” property"><span class="type">“flags”</span></a> property you will be able to read the GUID of the other peer here after the connection has been successfully initialized.</p> <p>Owner: GDBusConnection</p> <p>Flags: Read / Write / Construct Only</p> <p>Default value: NULL</p> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusConnection--stream"></a><h3>The <code class="literal">“stream”</code> property</h3> <pre class="programlisting"> “stream” <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a> *</pre> <p>The underlying <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a> used for I/O.</p> <p>If this is passed on construction and is a <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a>, then the corresponding <a class="link" href="GSocket.html" title="GSocket"><span class="type">GSocket</span></a> will be put into non-blocking mode.</p> <p>While the <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> is active, it will interact with this stream from a worker thread, so it is not safe to interact with the stream directly.</p> <p>Owner: GDBusConnection</p> <p>Flags: Read / Write / Construct Only</p> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> <hr> <div class="refsect2"> <a name="GDBusConnection--unique-name"></a><h3>The <code class="literal">“unique-name”</code> property</h3> <pre class="programlisting"> “unique-name” <span class="type">gchar</span> *</pre> <p>The unique name as assigned by the message bus or <code class="literal">NULL</code> if the connection is not open or not a message bus connection.</p> <p>Owner: GDBusConnection</p> <p>Flags: Read</p> <p>Default value: NULL</p> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> </div> <div class="refsect1"> <a name="GDBusConnection.signal-details"></a><h2>Signal Details</h2> <div class="refsect2"> <a name="GDBusConnection-closed"></a><h3>The <code class="literal">“closed”</code> signal</h3> <pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> *connection, <span class="type">gboolean</span> remote_peer_vanished, <span class="type">GError</span> *error, <span class="type">gpointer</span> user_data)</pre> <p>Emitted when the connection is closed.</p> <p>The cause of this event can be</p> <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"><p>If <a class="link" href="GDBusConnection.html#g-dbus-connection-close" title="g_dbus_connection_close ()"><code class="function">g_dbus_connection_close()</code></a> is called. In this case <em class="parameter"><code>remote_peer_vanished</code></em> is set to <code class="literal">FALSE</code> and <em class="parameter"><code>error</code></em> is <code class="literal">NULL</code>.</p></li> <li class="listitem"><p>If the remote peer closes the connection. In this case <em class="parameter"><code>remote_peer_vanished</code></em> is set to <code class="literal">TRUE</code> and <em class="parameter"><code>error</code></em> is set.</p></li> <li class="listitem"><p>If the remote peer sends invalid or malformed data. In this case <em class="parameter"><code>remote_peer_vanished</code></em> is set to <code class="literal">FALSE</code> and <em class="parameter"><code>error</code></em> is set.</p></li> </ul></div> <p>Upon receiving this signal, you should give up your reference to <em class="parameter"><code>connection</code></em> . You are guaranteed that this signal is emitted only once.</p> <div class="refsect3"> <a name="GDBusConnection-closed.parameters"></a><h4>Parameters</h4> <div class="informaltable"><table class="informaltable" width="100%" border="0"> <colgroup> <col width="150px" class="parameters_name"> <col class="parameters_description"> <col width="200px" class="parameters_annotations"> </colgroup> <tbody> <tr> <td class="parameter_name"><p>connection</p></td> <td class="parameter_description"><p>the <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> emitting the signal</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>remote_peer_vanished</p></td> <td class="parameter_description"><p><code class="literal">TRUE</code> if <em class="parameter"><code>connection</code></em> is closed because the remote peer closed its end of the connection</p></td> <td class="parameter_annotations"> </td> </tr> <tr> <td class="parameter_name"><p>error</p></td> <td class="parameter_description"><p>a <span class="type">GError</span> with more details about the event or <code class="literal">NULL</code>. </p></td> <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td> </tr> <tr> <td class="parameter_name"><p>user_data</p></td> <td class="parameter_description"><p>user data set when the signal handler was connected.</p></td> <td class="parameter_annotations"> </td> </tr> </tbody> </table></div> </div> <p>Flags: Run Last</p> <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p> </div> </div> </div> <div class="footer"> <hr>Generated by GTK-Doc V1.32</div> </body> </html>