]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/sd_bus_set_connected_signal.xml
man: standarize on one-line license header
[thirdparty/systemd.git] / man / sd_bus_set_connected_signal.xml
CommitLineData
514094f9 1<?xml version='1.0'?>
d97eac36
LP
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
0307f791 4<!-- SPDX-License-Identifier: LGPL-2.1+ -->
d97eac36 5
7647c01d
LP
6<refentry id="sd_bus_set_connected_signal"
7 xmlns:xi="http://www.w3.org/2001/XInclude">
d97eac36
LP
8
9 <refentryinfo>
10 <title>sd_bus_set_connected_signal</title>
11 <productname>systemd</productname>
d97eac36
LP
12 </refentryinfo>
13
14 <refmeta>
15 <refentrytitle>sd_bus_set_connected_signal</refentrytitle>
16 <manvolnum>3</manvolnum>
17 </refmeta>
18
19 <refnamediv>
20 <refname>sd_bus_set_connected_signal</refname>
21 <refname>sd_bus_get_connected_signal</refname>
22
23 <refpurpose>Control emmission of local connection establishment signal on bus connections</refpurpose>
24 </refnamediv>
25
26 <refsynopsisdiv>
27 <funcsynopsis>
28 <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
29
30 <funcprototype>
31 <funcdef>int <function>sd_bus_set_connected_signal</function></funcdef>
32 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
33 <paramdef>int <parameter>b</parameter></paramdef>
34 </funcprototype>
35
36 <funcprototype>
37 <funcdef>int <function>sd_bus_get_connected_signal</function></funcdef>
38 <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
39 </funcprototype>
40
41 </funcsynopsis>
42 </refsynopsisdiv>
43
44 <refsect1>
45 <title>Description</title>
46
47 <para><function>sd_bus_set_connected_signal()</function> may be used to control whether a local, synthetic
48 <function>Connected()</function> signal message shall be generated and enqueued for dispatching when the connection
49 is fully established. If the <parameter>b</parameter> parameter is zero the message is not generated (the default),
50 otherwise it is generated.</para>
51
52 <para><function>sd_bus_get_connected_signal()</function> may be used to query whether this feature is enabled. It
53 returns zero if not, positive otherwise.</para>
54
55 <para>The <function>Connected()</function> signal message is generated from the
56 <literal>org.freedesktop.DBus.Local</literal> service and interface, and
57 <literal>/org/freedesktop/DBus/Local</literal> object path. Use
58 <citerefentry><refentrytitle>sd_bus_match_signal_async</refentrytitle><manvolnum>3</manvolnum></citerefentry> to
59 match on this signal.</para>
60
61 <para>This message is particularly useful on slow transports where connections take a long time to be
62 established. This is especially the case when
63 <citerefentry><refentrytitle>sd_bus_set_watch_bind</refentrytitle><manvolnum>3</manvolnum></citerefentry> is
64 used. The signal is generated when the
65 <citerefentry><refentrytitle>sd_bus_is_ready</refentrytitle><manvolnum>3</manvolnum></citerefentry> returns
66 positive for the first time.</para>
67
68 <para>The <function>Connected()</function> signal corresponds with the <function>Disconnected()</function> signal
69 that is synthesized locally when the connection is terminated. The latter is generated unconditionally however,
70 unlike the former which needs to be enabled explicitly before it is generated, with
71 <function>sd_bus_set_connected_signal()</function>.</para>
72 </refsect1>
73
74 <refsect1>
75 <title>Return Value</title>
76
77 <para>On success, these functions return 0 or a positive integer. On failure, they return a negative errno-style
78 error code.</para>
79 </refsect1>
80
81 <refsect1>
82 <title>Errors</title>
83
84 <para>Returned errors may indicate the following problems:</para>
85
86 <variablelist>
87 <varlistentry>
88 <term><constant>-ECHILD</constant></term>
89
90 <listitem><para>The bus connection has been created in a different process.</para></listitem>
91 </varlistentry>
92 </variablelist>
93 </refsect1>
94
7647c01d 95 <xi:include href="libsystemd-pkgconfig.xml" />
d97eac36
LP
96
97 <refsect1>
98 <title>See Also</title>
99
100 <para>
101 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
102 <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
103 <citerefentry><refentrytitle>sd_bus_match_signal_async</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
104 <citerefentry><refentrytitle>sd_bus_set_watch_bind</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
105 <citerefentry><refentrytitle>sd_bus_is_ready</refentrytitle><manvolnum>3</manvolnum></citerefentry>
106 </para>
107 </refsect1>
108
109</refentry>